Skip to content

Commit 9515da1

Browse files
committed
Another leak fixed
It's really hard to weaken assertions so that they can deal with all possible random crap input.
1 parent e375b0b commit 9515da1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-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
@@ -718,7 +718,7 @@ trait Checking {
718718
val conv =
719719
if (sym.isOneOf(GivenOrImplicit) || sym.info.isErroneous) sym
720720
else {
721-
assert(sym.name == nme.apply)
721+
assert(sym.name == nme.apply || ctx.reporter.errorsReported)
722722
sym.owner
723723
}
724724
val conversionOK =

tests/neg/i7750a.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def foo: Unit = {
2+
val a = (x: Int, y: String) => x + + y // error
3+
implicit def f[X](x: (X, String) => String) = (z: X) => (z, null) // error
4+
a(1)
5+
}

0 commit comments

Comments
 (0)