Skip to content

Commit fd7f451

Browse files
committed
Consider S a pseudo match alias
Fixes tests/pos/i18211.scala, where type avoidance would cause `S[? <: Int]` which would otherwise be consider an unreducible wild and lead to Any which isn't <: Int.
1 parent 2f6e60d commit fd7f451

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -4633,6 +4633,7 @@ object Types extends TypeUtils {
46334633
*/
46344634
def isUnreducibleWild(using Context): Boolean =
46354635
tycon.isLambdaSub && hasWildcardArg && !isMatchAlias
4636+
&& !(args.sizeIs == 1 && defn.isCompiletime_S(tycon.typeSymbol)) // S is a pseudo Match Alias
46364637

46374638
def tryCompiletimeConstantFold(using Context): Type =
46384639
if myEvalRunId == ctx.runId then myEvalued

0 commit comments

Comments
 (0)