Skip to content

Commit c22d468

Browse files
committed
Merge pull request #430 from dotty-staging/fix/#429-enclosingMethod
Fix #429
2 parents 9b6e0ab + 261c87b commit c22d468

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,8 @@ object SymDenotations {
744744
final def enclosingMethod(implicit ctx: Context): Symbol =
745745
if (this is (Method, butNot = Label)) symbol
746746
else if (this.isClass) primaryConstructor
747-
else owner.enclosingMethod
747+
else if (this.exists) owner.enclosingMethod
748+
else NoSymbol
748749

749750
/** The top-level class containing this denotation,
750751
* except for a toplevel module, where its module class is returned.

tests/pos/KillLambdaLift.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class KillLambdaLift {
2+
private def com: this.type = _root_.scala.Predef.???
3+
}

0 commit comments

Comments
 (0)