Skip to content

Commit be83acd

Browse files
author
Hamza Remmal
committed
patch span of a template
1 parent 6e370a9 commit be83acd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2553,7 +2553,7 @@ object Parsers {
25532553
*/
25542554
def newExpr(): Tree =
25552555
val start = in.skipToken()
2556-
def reposition(t: Tree) = t.withSpan(Span(start, in.lastOffset))
2556+
def reposition(t: Tree) = t.withSpan(Span(start, in.lastCharOffset))
25572557
possibleTemplateStart()
25582558
val parents =
25592559
if in.isNestedStart then Nil

tests/neg/i18265.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trait Foo
2+
3+
val foo = new Foo:
4+
extension (s: String)
5+
def twice

0 commit comments

Comments
 (0)