Skip to content

Commit 6c14f81

Browse files
committed
Revert "Give Closure trees the span of the underling function"
This reverts commit 99d8395.
1 parent 03a29ca commit 6c14f81

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,9 +1339,7 @@ object desugar {
13391339
DefDef(nme.ANON_FUN, params :: Nil, if (tpt == null) TypeTree() else tpt, body)
13401340
.withSpan(span)
13411341
.withMods(synthetic | Artifact),
1342-
Closure(Nil, Ident(nme.ANON_FUN), if (isContextual) ContextualEmptyTree else EmptyTree)
1343-
.withSpan(span)
1344-
)
1342+
Closure(Nil, Ident(nme.ANON_FUN), if (isContextual) ContextualEmptyTree else EmptyTree))
13451343

13461344
/** If `nparams` == 1, expand partial function
13471345
*

tests/neg/i7746.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class A {
2-
def foo = (x : Int, y => x) => () // error: not a gel formal parameter
2+
def foo = (x : Int, y => x) => () // error // error
33
}

tests/neg/i9299.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type F <: F = 1 match { // error: Recursion limit exceeded.
2-
case _ => foo.foo // error: Recursion limit exceeded.
1+
type F <: F = 1 match { // error
2+
case _ => foo.foo // error // error
33
}
44
def foo(a: Int): Unit = ???

0 commit comments

Comments
 (0)