Skip to content

Commit 9488f88

Browse files
committed
Exclude TypeBox applications from bounds checking
1 parent 77f43f5 commit 9488f88

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ object Checking {
103103
HKTypeLambda.fromParams(tparams, bound).appliedTo(args)
104104
case _ =>
105105
bound // paramInfoAsSeenFrom already took care of instantiation in this case
106-
if !ctx.mode.is(Mode.Pattern) then
106+
if !ctx.mode.is(Mode.Pattern) // no bounds checking in patterns
107+
&& tycon.symbol != defn.TypeBoxClass // TypeBox types are generated for capture
108+
// conversion, may contain AnyKind as arguments
109+
then
107110
checkBounds(args, bounds, instantiate, tree.tpe, tpt)
108111

109112
def checkWildcardApply(tp: Type): Unit = tp match {

0 commit comments

Comments
 (0)