Skip to content

Commit b97665a

Browse files
Merge pull request #11116 from dotty-staging/fix-#11075
Handle abstract inline methods in TreeUnpickler
2 parents eb2f503 + ca6e375 commit b97665a

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ class TreeUnpickler(reader: TastyReader,
602602
sym.completer.withDecls(newScope)
603603
forkAt(templateStart).indexTemplateParams()(using localContext(sym))
604604
}
605-
else if (sym.isInlineMethod)
605+
else if (sym.isInlineMethod && !sym.is(Deferred))
606606
sym.addAnnotation(LazyBodyAnnotation { (ctx0: Context) ?=>
607607
val ctx1 = localContext(sym)(using ctx0).addMode(Mode.ReadPositions)
608608
inContext(sourceChangeContext(Addr(0))(using ctx1)) {

tests/pos/i11075/A_1.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trait A {
2+
inline def a: Int
3+
}

tests/pos/i11075/B_2.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trait B extends A {
2+
inline def a: Int = 0
3+
}

0 commit comments

Comments
 (0)