File tree 1 file changed +5
-5
lines changed
src/dotty/tools/dotc/typer 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -934,11 +934,10 @@ class Namer { typer: Typer =>
934
934
}
935
935
936
936
def typeDefSig (tdef : TypeDef , sym : Symbol , tparamSyms : List [TypeSymbol ])(implicit ctx : Context ): Type = {
937
- def abstracted (tp : Type , canAbstract : Boolean ): Type =
938
- if (tparamSyms.nonEmpty && canAbstract) tp.LambdaAbstract (tparamSyms)
939
- else tp
937
+ def abstracted (tp : Type ): Type =
938
+ if (tparamSyms.nonEmpty) tp.LambdaAbstract (tparamSyms) else tp
940
939
941
- val dummyInfo = abstracted(TypeBounds .empty, canAbstract = true )
940
+ val dummyInfo = abstracted(TypeBounds .empty)
942
941
sym.info = dummyInfo
943
942
// Temporarily set info of defined type T to ` >: Nothing <: Any.
944
943
// This is done to avoid cyclic reference errors for F-bounds.
@@ -952,7 +951,8 @@ class Namer { typer: Typer =>
952
951
// inspects a TypeRef's info, instead of simply dealiasing alias types.
953
952
954
953
val isDerived = tdef.rhs.isInstanceOf [untpd.DerivedTypeTree ]
955
- val rhsType = abstracted(typedAheadType(tdef.rhs).tpe, canAbstract = ! isDerived)
954
+ val rhsBodyType = typedAheadType(tdef.rhs).tpe
955
+ val rhsType = if (isDerived) rhsBodyType else abstracted(rhsBodyType)
956
956
val unsafeInfo = rhsType match {
957
957
case bounds : TypeBounds => bounds
958
958
case alias => TypeAlias (alias, if (sym is Local ) sym.variance else 0 )
You can’t perform that action at this time.
0 commit comments