File tree 1 file changed +11
-9
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -4105,18 +4105,20 @@ object Types {
4105
4105
4106
4106
override def underlying (using Context ): Type = tycon
4107
4107
4108
- override def superType (using Context ): Type = {
4109
- if (ctx.period != validSuper) {
4110
- cachedSuper = tycon match {
4108
+ override def superType (using Context ): Type =
4109
+ if ctx.period != validSuper then
4110
+ validSuper = if (tycon.isProvisional) Nowhere else ctx.period
4111
+ def reappliedSuper = tycon.superType.applyIfParameterized(args).normalized
4112
+ cachedSuper = tycon match
4111
4113
case tycon : HKTypeLambda => defn.AnyType
4112
- case tycon : TypeRef if tycon.symbol.isClass => tycon
4113
- case tycon : TypeProxy => tycon.superType.applyIfParameterized(args).normalized
4114
+ case tycon : TypeRef =>
4115
+ if tycon.symbol.isClass then tycon
4116
+ else
4117
+ if tycon.info.isInstanceof[MatchAlias ] then validSuper = Nowhere
4118
+ reappliedSuper
4119
+ case tycon : TypeProxy => reappliedSuper
4114
4120
case _ => defn.AnyType
4115
- }
4116
- validSuper = if (tycon.isProvisional) Nowhere else ctx.period
4117
- }
4118
4121
cachedSuper
4119
- }
4120
4122
4121
4123
override def translucentSuperType (using Context ): Type = tycon match {
4122
4124
case tycon : TypeRef if tycon.symbol.isOpaqueAlias =>
You can’t perform that action at this time.
0 commit comments