Skip to content

Commit

Permalink
Consider S a pseudo match alias
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dwijnand committed Dec 4, 2024
1 parent 2f6e60d commit fd7f451
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4633,6 +4633,7 @@ object Types extends TypeUtils {
*/
def isUnreducibleWild(using Context): Boolean =
tycon.isLambdaSub && hasWildcardArg && !isMatchAlias
&& !(args.sizeIs == 1 && defn.isCompiletime_S(tycon.typeSymbol)) // S is a pseudo Match Alias

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

0 comments on commit fd7f451

Please sign in to comment.