Skip to content

Commit 83ac988

Browse files
committed
Allow capture conversion after typer
It seems this is necessary for code generation. We got abstract method errors in typer/TermRefSet otherwise: ``` java.lang.AbstractMethodError: Method dotty/tools/dotc/typer/TermRefSet$$anon$1.accept(Ljava/lang/Object;Ljava/lang/Object;)V is abstract, took 2.601 sec [error] at dotty.tools.dotc.typer.TermRefSet$$anon$1.accept(Implicits.scala) [error] at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) [error] at dotty.tools.dotc.typer.TermRefSet.foreach(Implicits.scala:1638) [error] at dotty.tools.dotc.typer.TermRefSet.$plus$plus$eq(Implicits.scala:1634) ```
1 parent e04918e commit 83ac988

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,12 +1041,12 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
10411041
arg1 match {
10421042
case arg1: TypeBounds =>
10431043
tparam match {
1044-
case tparam: Symbol if leftRoot.isStable =>
1044+
case tparam: Symbol if leftRoot.isStable || ctx.isAfterTyper =>
10451045
val captured = TypeRef(leftRoot, tparam)
10461046
isSubArg(captured, arg2)
10471047
case _ =>
10481048
false
1049-
}
1049+
}
10501050
case _ =>
10511051
(v > 0 || isSubType(arg2, arg1)) &&
10521052
(v < 0 || isSubType(arg1, arg2))

0 commit comments

Comments
 (0)