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.
1 parent d45fea0 commit 3d708acCopy full SHA for 3d708ac
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -2548,7 +2548,7 @@ class Typer extends Namer
2548
adapt(tree, pt, ctx.typerState.ownedVars)
2549
2550
private def adapt1(tree: Tree, pt: Type, locked: TypeVars)(implicit ctx: Context): Tree = {
2551
- assert(pt.exists && !pt.isInstanceOf[ExprType])
+ assert(pt.exists && !pt.isInstanceOf[ExprType] || ctx.reporter.errorsReported)
2552
def methodStr = err.refStr(methPart(tree).tpe)
2553
2554
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