File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2182,14 +2182,16 @@ object Types {
2182
2182
2183
2183
// --- NamedTypes ------------------------------------------------------------------
2184
2184
2185
- abstract class NamedType extends CachedProxyType , ValueType { self =>
2185
+ abstract class NamedType extends CachedProxyType , ValueType , Product { self =>
2186
2186
2187
2187
type ThisType >: this .type <: NamedType
2188
2188
type ThisName <: Name
2189
2189
2190
2190
val prefix : Type
2191
2191
def designator : Designator
2192
2192
protected def designator_= (d : Designator ): Unit
2193
+ def _1 : Type
2194
+ def _2 : Designator
2193
2195
2194
2196
assert(NamedType .validPrefix(prefix), s " invalid prefix $prefix" )
2195
2197
@@ -2905,6 +2907,7 @@ object Types {
2905
2907
def apply (prefix : Type , designator : Name , denot : Denotation )(using Context ): NamedType =
2906
2908
if (designator.isTermName) TermRef .apply(prefix, designator.asTermName, denot)
2907
2909
else TypeRef .apply(prefix, designator.asTypeName, denot)
2910
+ def unapply (tp : NamedType ): NamedType = tp
2908
2911
2909
2912
def validPrefix (prefix : Type ): Boolean = prefix.isValueType || (prefix eq NoPrefix )
2910
2913
}
Original file line number Diff line number Diff line change @@ -611,11 +611,11 @@ object SpaceEngine {
611
611
case tp if ! TypeComparer .provablyDisjoint(tp, tpB) => AndType (tp, tpB)
612
612
613
613
case OrType (tp1, tp2) => List (tp1, tp2)
614
- case _ : SingletonType => ListOfNoType
615
614
case tp if tp.isRef(defn.BooleanClass ) => List (ConstantType (Constant (true )), ConstantType (Constant (false )))
616
615
case tp if tp.isRef(defn.UnitClass ) => ConstantType (Constant (())) :: Nil
617
616
case tp if tp.classSymbol.isAllOf(JavaEnumTrait ) => tp.classSymbol.children.map(_.termRef)
618
- case tp @ TypeRef (Parts (parts), _) => parts.map(tp.derivedSelect)
617
+ case tp @ NamedType (Parts (parts), _) => parts.map(tp.derivedSelect)
618
+ case _ : SingletonType => ListOfNoType
619
619
620
620
case tp @ AppliedType (Parts (parts), targs) if tp.classSymbol.children.isEmpty =>
621
621
// It might not obvious that it's OK to apply the type arguments of a parent type to child types.
You can’t perform that action at this time.
0 commit comments