Skip to content

Commit 75ef1d3

Browse files
dwijnandtgodzik
authored andcommitted
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. [Cherry-picked fd7f451]
1 parent 67d64ae commit 75ef1d3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4557,6 +4557,7 @@ object Types extends TypeUtils {
45574557
*/
45584558
def isUnreducibleWild(using Context): Boolean =
45594559
tycon.isLambdaSub && hasWildcardArg && !isMatchAlias
4560+
&& !(args.sizeIs == 1 && defn.isCompiletime_S(tycon.typeSymbol)) // S is a pseudo Match Alias
45604561

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

0 commit comments

Comments
 (0)