Skip to content

Commit 68993d5

Browse files
committed
Fix #7750: Circumvent an assertion failure for erroneous code
1 parent 9aa7991 commit 68993d5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ trait Checking {
716716
def checkImplicitConversionUseOK(sym: Symbol, posd: Positioned)(implicit ctx: Context): Unit =
717717
if (sym.exists) {
718718
val conv =
719-
if (sym.isOneOf(GivenOrImplicit)) sym
719+
if (sym.isOneOf(GivenOrImplicit) || sym.info.isErroneous) sym
720720
else {
721721
assert(sym.name == nme.apply)
722722
sym.owner

tests/neg/i7750.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package object A extends runtime.A {
2+
implicit def a( : ) = 1()
3+
}

0 commit comments

Comments
 (0)