We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 25fb86b + 3d708ac commit 64b4eb4Copy full SHA for 64b4eb4
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -2552,7 +2552,7 @@ class Typer extends Namer
2552
adapt(tree, pt, ctx.typerState.ownedVars)
2553
2554
private def adapt1(tree: Tree, pt: Type, locked: TypeVars)(implicit ctx: Context): Tree = {
2555
- assert(pt.exists && !pt.isInstanceOf[ExprType])
+ assert(pt.exists && !pt.isInstanceOf[ExprType] || ctx.reporter.errorsReported)
2556
def methodStr = err.refStr(methPart(tree).tpe)
2557
2558
def readapt(tree: Tree)(implicit ctx: Context) = adapt(tree, pt, locked)
tests/neg/i7808.scala
@@ -0,0 +1,10 @@
1
+object A {
2
+ {
3
+ val a: Int = 1
4
+ object a { // error
5
+ this match {
6
+ case _ => ()
7
+ }
8
9
10
+}
0 commit comments