File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
jvm/src/test/scala-2/org/typelevel/twiddles/test
shared/src/main/scala-2/org/typelevel/twiddles Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,36 @@ class CompilationPerformanceSpec extends FunSuite {
6161 assert(compiled.isInstanceOf [Tuple ])
6262 }
6363
64+ test(" should subtype in a reasonable amount of time" ) {
65+ val compiled = compileWithin(
66+ q """ import org.typelevel.twiddles._
67+ val inferred =
68+ 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *:
69+ 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *:
70+ 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *:
71+ 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *:
72+ 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *:
73+ 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *:
74+ 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *:
75+ 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *: 1 *:
76+ EmptyTuple
77+ type Expected =
78+ Int *: Int *: Int *: Int *: Int *: Int *: Int *: Int *:
79+ Int *: Int *: Int *: Int *: Int *: Int *: Int *: Int *:
80+ Int *: Int *: Int *: Int *: Int *: Int *: Int *: Int *:
81+ Int *: Int *: Int *: Int *: Int *: Int *: Int *: Int *:
82+ Int *: Int *: Int *: Int *: Int *: Int *: Int *: Int *:
83+ Int *: Int *: Int *: Int *: Int *: Int *: Int *: Int *:
84+ Int *: Int *: Int *: Int *: Int *: Int *: Int *: Int *:
85+ Int *: Int *: Int *: Int *: Int *: Int *: Int *: Int *:
86+ EmptyTuple
87+ inferred: Expected """ ,
88+ 10 .seconds
89+ )
90+
91+ assert(compiled.isInstanceOf [Tuple ])
92+ }
93+
6494 private val toolbox = {
6595 val toolbox = currentMirror.mkToolBox()
6696 // warmup
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ trait TwiddleCompat {
4242 type EmptyTuple = HNil
4343 @ inline val EmptyTuple : EmptyTuple = HNil
4444
45- type *: [A , B <: Tuple ] = :: [A , B ]
45+ type *: [+ A , + B <: Tuple ] = :: [A , B ]
4646 @ inline val *: = ::
4747
4848 implicit def toTupleOps [T <: Tuple ](t : T ): TupleOps [T ] =
You can’t perform that action at this time.
0 commit comments