File tree 2 files changed +5
-2
lines changed
compiler/src/dotty/tools/dotc/typer
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) {
180
180
sym.is(PrivateLocal ) ||
181
181
sym.name.is(InlineAccessorName ) || // TODO: should we exclude all synthetic members?
182
182
sym.is(TypeParam ) && sym.owner.isClass // already taken care of in primary constructor of class
183
- tree match {
183
+ try tree match {
184
184
case defn : MemberDef if skip =>
185
185
ctx.debuglog(s " Skipping variance check of ${sym.showDcl}" )
186
186
case tree : TypeDef =>
@@ -197,6 +197,9 @@ class VarianceChecker()(implicit ctx: Context) {
197
197
vparamss foreach (_ foreach traverse)
198
198
case _ =>
199
199
}
200
+ catch {
201
+ case ex : TypeError => ctx.error(ex.toMessage, tree.sourcePos.focus)
202
+ }
200
203
}
201
204
}
202
205
}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ object Test {
11
11
val x : Int = g[Int ] // error: found: L[Int], required: Int
12
12
13
13
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
15
15
def gg [X ]: LL [X ] = ???
16
16
val xx : Int = gg[Int ] // error: recursion limit exceeded with reduce type LazyRef(Test.LL[Int]) match ...
17
17
}
You can’t perform that action at this time.
0 commit comments