File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ class VarianceChecker()(implicit ctx: Context) {
180180 sym.is(PrivateLocal ) ||
181181 sym.name.is(InlineAccessorName ) || // TODO: should we exclude all synthetic members?
182182 sym.is(TypeParam ) && sym.owner.isClass // already taken care of in primary constructor of class
183- tree match {
183+ try tree match {
184184 case defn : MemberDef if skip =>
185185 ctx.debuglog(s " Skipping variance check of ${sym.showDcl}" )
186186 case tree : TypeDef =>
@@ -197,6 +197,9 @@ class VarianceChecker()(implicit ctx: Context) {
197197 vparamss foreach (_ foreach traverse)
198198 case _ =>
199199 }
200+ catch {
201+ case ex : TypeError => ctx.error(ex.toMessage, tree.sourcePos.focus)
202+ }
200203 }
201204 }
202205}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ object Test {
1111 val x : Int = g[Int ] // error: found: L[Int], required: Int
1212
1313 def aa : LL [Boolean ] = ???
14- def bb : LL [Int ] = ??? // error: recursion limit exceeded with reduce type LazyRef(Test.LL[Int]) match ...
14+ def bb : LL [Int ] = ??? // error: recursion limit exceeded with reduce type LazyRef(Test.LL[Int]) match ... // error
1515 def gg [X ]: LL [X ] = ???
1616 val xx : Int = gg[Int ] // error: recursion limit exceeded with reduce type LazyRef(Test.LL[Int]) match ...
1717}
You can’t perform that action at this time.
0 commit comments