File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -146,12 +146,17 @@ object Checking {
146
146
def traverse (tp : Type ) =
147
147
tp match
148
148
case AppliedType (tycon, argTypes)
149
- if ! (tycon.typeSymbol.is(JavaDefined ) && ctx.compilationUnit.isJava) =>
149
+ if ! (tycon.typeSymbol.is(JavaDefined ) && ctx.compilationUnit.isJava)
150
150
// Don't check bounds in Java units that refer to Java type constructors.
151
151
// Scala is not obliged to do Java type checking and in fact i17763 goes wrong
152
152
// if we attempt to check bounds of F-bounded mutually recursive Java interfaces.
153
153
// Do check all bounds in Scala units and those bounds in Java units that
154
154
// occur in applications of Scala type constructors.
155
+ && ! (ctx.phase == Phases .checkCapturesPhase && ! tycon.typeSymbol.is(CaptureChecked ))
156
+ // Don't check bounds when capture checking type constructors that were not
157
+ // themselves capture checked. Since the type constructor could not foresee
158
+ // possible capture sets, it's better to be lenient for backwards compatibility.
159
+ =>
155
160
checkAppliedType(
156
161
untpd.AppliedTypeTree (TypeTree (tycon), argTypes.map(TypeTree (_)))
157
162
.withType(tp).withSpan(tpt.span.toSynthetic),
You can’t perform that action at this time.
0 commit comments