Skip to content

Commit c54c538

Browse files
committed
Fix checking condition
1 parent 1231728 commit c54c538

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ object Checking {
156156
// if we attempt to check bounds of F-bounded mutually recursive Java interfaces.
157157
// Do check all bounds in Scala units and those bounds in Java units that
158158
// occur in applications of Scala type constructors.
159-
&& tycon.typeSymbol.is(CaptureChecked)
160-
// Exempted are types that are not themselves capture-checked.
161-
// Since the type constructor could not foresee possible capture sets,
162-
// it's better to be lenient for backwards compatibility.
159+
&& (!isCaptureChecking || tycon.typeSymbol.is(CaptureChecked))
160+
// When capture checking, types that are not themselves capture-checked
161+
// are exempted. Since the type constructor could not foresee possible
162+
// capture sets, it's better to be lenient for backwards compatibility.
163163
then
164164
checkAppliedType(
165165
untpd.AppliedTypeTree(TypeTree(tycon), argTypes.map(TypeTree(_)))

0 commit comments

Comments
 (0)