From 13bc962a8d2d1598476bc13bdd5dd0ec6d9a39bc Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 15 Jan 2020 16:45:11 +0100 Subject: [PATCH] Fix #8002: Drop wrong assertion --- compiler/src/dotty/tools/dotc/typer/Applications.scala | 6 +----- tests/neg/i8002.scala | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 tests/neg/i8002.scala 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