File tree 1 file changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/core 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,12 @@ class TypeUtils {
65
65
case tp : AppliedType if defn.isTupleNType(tp) && normalize =>
66
66
Some (tp.args) // if normalize is set, use the dealiased tuple
67
67
// otherwise rely on the default case below to print unaliased tuples.
68
+ case tp : SkolemType =>
69
+ recur(tp.underlying, bound)
68
70
case tp : SingletonType =>
69
- if tp.termSymbol == defn.EmptyTupleModule then Some (Nil ) else None
71
+ if tp.termSymbol == defn.EmptyTupleModule then Some (Nil )
72
+ else if normalize then recur(tp.widen, bound)
73
+ else None
70
74
case _ =>
71
75
if defn.isTupleClass(tp.typeSymbol) && ! normalize then Some (tp.dealias.argInfos)
72
76
else None
@@ -84,6 +88,9 @@ class TypeUtils {
84
88
case Some (elems) if elems.length <= Definitions .MaxTupleArity => true
85
89
case _ => false
86
90
91
+ /** Is this type a named tuple element `name = value`? */
92
+ def isNamedTupleElem (using Context ): Boolean = defn.NamedTupleElem .unapply(self).isDefined
93
+
87
94
/** The `*:` equivalent of an instance of a Tuple class */
88
95
def toNestedPairs (using Context ): Type =
89
96
tupleElementTypes match
You can’t perform that action at this time.
0 commit comments