Skip to content

Commit f1996fa

Browse files
author
Dean Wampler
committed
The Peano number support "S" was moved to scala.compiletime.ops.int
1 parent ba3f2d2 commit f1996fa

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/script/scala/progscala3/typesystem/deptypes/DependentTypesBounds.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// dependent types. This file focuses on recursive match types for integer
66
// ranges.
77

8-
import scala.compiletime.S
98
import scala.compiletime.ops.int.*
109

1110
// A type that allows values between MIN and MAX, inclusive.
@@ -21,11 +20,10 @@ val b7: Bounded[4,6] = 7 // ERROR
2120

2221
// A type with allowed values between 0 and N-1, inclusive, the same numbers
2322
// for indexing into a sequence of size N!
24-
type IndexOf[N] = Bounded[0,N-1]
23+
type IndexOf[N <: Int] = Bounded[0,N-1]
2524

2625
val im1: IndexOf[3] = -1 // ERROR
2726
val i0: IndexOf[3] = 0
2827
val i1: IndexOf[3] = 1
2928
val i2: IndexOf[3] = 2
3029
val i3: IndexOf[3] = 3 // ERROR
31-

src/script/scala/progscala3/typesystem/deptypes/DependentTypesTuples.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// can manipulate tuples like lists. Here, we'll experiment with dependent
77
// types and the allowed arities (sizes) of the tuples.
88

9-
import scala.compiletime.S
109
import scala.compiletime.ops.int.*
1110

1211
// Only allow tuple values with exactly N elements.

0 commit comments

Comments
 (0)