File tree 2 files changed +50
-1
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -4110,7 +4110,7 @@ object Types {
4110
4110
cachedSuper = tycon match {
4111
4111
case tycon : HKTypeLambda => defn.AnyType
4112
4112
case tycon : TypeRef if tycon.symbol.isClass => tycon
4113
- case tycon : TypeProxy => tycon.superType.applyIfParameterized(args)
4113
+ case tycon : TypeProxy => tycon.superType.applyIfParameterized(args).normalized
4114
4114
case _ => defn.AnyType
4115
4115
}
4116
4116
validSuper = if (tycon.isProvisional) Nowhere else ctx.period
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ type inserts [a, as <: Tuple ] <: Tuple =
3
+ as match
4
+ case EmptyTuple => (a *: EmptyTuple ) *: EmptyTuple
5
+ case y *: ys => (a *: y *: ys) *: Tuple .Map [inserts[a, ys], [t <: Tuple ] =>> y *: t]
6
+
7
+ type inserts2 [a] =
8
+ [as <: Tuple ] =>> inserts[a, as]
9
+
10
+ type A = inserts [1 , EmptyTuple ]
11
+ type B = inserts2[1 ][EmptyTuple ]
12
+
13
+ summon[A =:= ((1 *: EmptyTuple ) *: EmptyTuple )]
14
+ summon[B =:= ((1 *: EmptyTuple ) *: EmptyTuple )]
15
+ summon[A =:= B ]
16
+
17
+ type H [t <: Tuple ] = Tuple .Concat [t, EmptyTuple ]
18
+
19
+ summon[H [A ] =:= H [B ]]
20
+
21
+ summon[Tuple .Concat [A , EmptyTuple ] =:= Tuple .Concat [B , EmptyTuple ]]
22
+ }
23
+
24
+ object Minimized {
25
+ type Concombre [X <: Tuple , + Y <: Tuple ] <: Tuple = X match {
26
+ case EmptyTuple => Y
27
+ case x1 *: xs1 => X
28
+ }
29
+
30
+ type inserts [a, as <: Tuple ] <: Tuple =
31
+ as match
32
+ case EmptyTuple => a *: EmptyTuple
33
+
34
+ type inserts2 [a] =
35
+ [as <: Tuple ] =>> inserts[a, as]
36
+
37
+ type A = inserts [1 , EmptyTuple ]
38
+ type B = inserts2[1 ][EmptyTuple ]
39
+ type C = 1 *: EmptyTuple
40
+
41
+ summon[A =:= B ]
42
+ summon[A =:= C ]
43
+ summon[B =:= C ]
44
+
45
+ type H [t <: Tuple ] = Concombre [t, EmptyTuple ]
46
+
47
+ summon[H [C ] =:= H [A ]]
48
+ summon[H [C ] =:= H [B ]]
49
+ }
You can’t perform that action at this time.
0 commit comments