We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5e27c1 commit e44e8f0Copy full SHA for e44e8f0
tests/pos/singleton-ops-test-issue-8280.scala
@@ -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