Skip to content

Commit e44e8f0

Browse files
committed
Add test
1 parent b5e27c1 commit e44e8f0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import scala.compiletime.ops.int._
2+
import scala.compiletime.S
3+
4+
class Foo[T <: Int] {
5+
def incP = new Foo[T + 1]
6+
def incS = new Foo[S[T]]
7+
}
8+
object Foo {
9+
def apply[T <: Int & Singleton](value : T) : Foo[T] = new Foo[T]
10+
}
11+
12+
val fincS : Foo[2] = Foo(1).incS
13+
val fincP1 : Foo[2] = Foo(1).incP
14+
val fincP2a = Foo(1).incP
15+
val fincP2b : Foo[2] = fincP2a
16+
val fincP3 : Foo[2] = (new Foo[1]).incP

0 commit comments

Comments
 (0)