File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2816,6 +2816,8 @@ object Types {
28162816 private var myRef : Type = null
28172817 private var computed = false
28182818
2819+ override def tryNormalize (using Context ): Type = ref.tryNormalize
2820+
28192821 def ref (using Context ): Type =
28202822 if computed then
28212823 if myRef == null then
Original file line number Diff line number Diff line change 1+ import scala .compiletime .ops .int .*
2+
3+ object Test {
4+ type Fib [N <: Int ] <: Int = N match {
5+ case 0 => 0
6+ case 1 => 1
7+ case Any => Fib [N - 1 ] + Fib [N - 2 ]
8+ }
9+ val fib0 : Fib [0 ] = 0
10+ val fib1 : Fib [1 ] = 1
11+ val fib2 : Fib [2 ] = 1
12+ val fib3 : Fib [3 ] = 2
13+ val fib4 : Fib [4 ] = 3
14+ val fib5 : Fib [5 ] = 5
15+ val fib6 : Fib [6 ] = 8
16+ }
You can’t perform that action at this time.
0 commit comments