Skip to content

Commit 45f1014

Browse files
committed
Cleanup
1 parent b8e0298 commit 45f1014

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

tests/run/fully-abstract-interface.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import scala.reflect.ClassTag
2-
import scala.tasty.FlagSet
32

43
object Test {
54
def main(args: Array[String]): Unit = {

tests/run/fully-abstract-nat.check

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
CaseClassImplementation
2-
underlying rep: Z()
2+
underlying rep: Z
33
test1 OK
44
test2 OK
55

6-
underlying rep: S(S(S(Z())))
6+
underlying rep: S(S(S(Z)))
77
test3 OK
8-
Succ(S(S(Z()))) = 3
8+
Succ(S(S(Z))) = 3
99
test4 OK
10-
Succ(S(S(Z()))) = 3
10+
Succ(S(S(Z))) = 3
1111

1212
IntImplementation
1313
underlying rep: 0

tests/run/fully-abstract-nat.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import scala.reflect.ClassTag
2-
import scala.tasty.FlagSet
32

43
object Test {
54
def main(args: Array[String]): Unit = {
@@ -119,7 +118,7 @@ abstract class Numbers {
119118
object CaseClassImplementation extends Numbers {
120119

121120
sealed trait N
122-
final case class Z() extends N
121+
final object Z extends N { override def toString: String = "Z" }
123122
final case class S(n: N) extends N
124123

125124
// === Nat ==========================================
@@ -138,12 +137,12 @@ object CaseClassImplementation extends Numbers {
138137

139138
// --- Zero ----------------------------------------
140139

141-
type Zero = Z
140+
type Zero = Z.type
142141

143142
def zeroClassTag: ClassTag[Zero] = implicitly
144143

145144
val Zero: ZeroExtractor = new ZeroExtractor {
146-
def apply(): Zero = new Z()
145+
def apply(): Zero = Z
147146
def unapply(zero: Zero): Boolean = true // checked by class tag before calling the unapply
148147
}
149148

0 commit comments

Comments
 (0)