diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 1c58ec570f24..c00888444ac2 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -602,7 +602,7 @@ class TreeUnpickler(reader: TastyReader, sym.completer.withDecls(newScope) forkAt(templateStart).indexTemplateParams()(using localContext(sym)) } - else if (sym.isInlineMethod) + else if (sym.isInlineMethod && !sym.is(Deferred)) sym.addAnnotation(LazyBodyAnnotation { (ctx0: Context) ?=> val ctx1 = localContext(sym)(using ctx0).addMode(Mode.ReadPositions) inContext(sourceChangeContext(Addr(0))(using ctx1)) { diff --git a/tests/pos/i11075/A_1.scala b/tests/pos/i11075/A_1.scala new file mode 100644 index 000000000000..c63b1017e898 --- /dev/null +++ b/tests/pos/i11075/A_1.scala @@ -0,0 +1,3 @@ +trait A { + inline def a: Int +} diff --git a/tests/pos/i11075/B_2.scala b/tests/pos/i11075/B_2.scala new file mode 100644 index 000000000000..e39a2222dc0f --- /dev/null +++ b/tests/pos/i11075/B_2.scala @@ -0,0 +1,3 @@ +trait B extends A { + inline def a: Int = 0 +}