diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 4ecdaeb83b5a..2e1a8cb72540 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -484,11 +484,7 @@ trait Applications extends Compatibility { cx.denotNamed(meth.name).hasAltWith(_.symbol == meth)) { val denot = cx.denotNamed(getterName) if (denot.exists) ref(TermRef(cx.owner.thisType, getterName, denot)) - else { - assert(ctx.mode.is(Mode.Interactive) || ctx.reporter.errorsReported, - s"non-existent getter denotation ($denot) for getter($getterName)") - findGetter(cx.outer) - } + else findGetter(cx.outer) } else findGetter(cx.outer) findGetter(ctx) diff --git a/tests/neg/i8002.scala b/tests/neg/i8002.scala new file mode 100644 index 000000000000..d14345d642d0 --- /dev/null +++ b/tests/neg/i8002.scala @@ -0,0 +1,5 @@ +class Foo + def f(x: Int, y: Int = 1) = ??? + +object bar extends Foo + f() // error: missing argument \ No newline at end of file