1
-
1
+ // This test requires retyping from untyped trees after inlining, which is not supported anymore
2
2
object typelevel {
3
3
case class Typed [T ](value : T ) { type Type = T }
4
4
}
@@ -21,7 +21,7 @@ object Test extends App {
21
21
type HNil = HNil .type
22
22
type Z = Z .type
23
23
24
- inline def ToNat (inline n : Int ): Typed [Nat ] =
24
+ inline def ToNat (inline n : Int ) < : Typed [Nat ] =
25
25
if n == 0 then Typed (Z )
26
26
else Typed (S (ToNat (n - 1 ).value))
27
27
@@ -35,7 +35,7 @@ object Test extends App {
35
35
println(x1)
36
36
println(x2)
37
37
38
- inline def toInt (n : Nat ): Int = inline n match {
38
+ inline def toInt (n : Nat ) < : Int = inline n match {
39
39
case Z => 0
40
40
case S (n1) => toInt(n1) + 1
41
41
}
@@ -45,7 +45,7 @@ object Test extends App {
45
45
inline val i2 = toInt(y2)
46
46
val j2 : 2 = i2
47
47
48
- inline def concat (xs : HList , ys : HList ): HList = inline xs match {
48
+ inline def concat (xs : HList , ys : HList ) < : HList = inline xs match {
49
49
case HNil => ys
50
50
case HCons (x, xs1) => HCons (x, concat(xs1, ys))
51
51
}
@@ -68,7 +68,7 @@ object Test extends App {
68
68
val r6 = concat(HCons (1 , HCons (" a" , HNil )), HCons (true , HCons (1.0 , HNil )))
69
69
val c6 : HCons [Int , HCons [String , HCons [Boolean , HCons [Double , HNil ]]]] = r6
70
70
71
- inline def nth (xs : HList , n : Int ): Any = inline xs match {
71
+ inline def nth (xs : HList , n : Int ) < : Any = inline xs match {
72
72
case HCons (x, _) if n == 0 => x
73
73
case HCons (_, xs1) if n > 0 => nth(xs1, n - 1 )
74
74
}
@@ -78,12 +78,12 @@ object Test extends App {
78
78
val e1 = nth(r2, 1 )
79
79
val ce1 : String = e1
80
80
81
- inline def concatTyped (xs : HList , ys : HList ): Typed [_ <: HList ] = inline xs match {
81
+ inline def concatTyped (xs : HList , ys : HList ) < : Typed [_ <: HList ] = inline xs match {
82
82
case HNil => Typed (ys)
83
83
case HCons (x, xs1) => Typed (HCons (x, concatTyped(xs1, ys).value))
84
84
}
85
85
86
- def concatImpl (xs : HList , ys : HList ): HList = xs match {
86
+ def concatImpl (xs : HList , ys : HList ) < : HList = xs match {
87
87
case HNil => ys
88
88
case HCons (x, xs1) => HCons (x, concatImpl(xs1, ys))
89
89
}
0 commit comments