Skip to content

Commit 67ad1f6

Browse files
move test to run-macros and update i7987.check with new mirror MirroredElemHasDefaults
1 parent a731965 commit 67ad1f6

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

tests/run-macros/i7987.check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ scala.deriving.Mirror.Product {
44
type MirroredLabel >: "Some" <: "Some"
55
type MirroredElemTypes >: scala.*:[scala.Int, scala.Tuple$package.EmptyTuple] <: scala.*:[scala.Int, scala.Tuple$package.EmptyTuple]
66
type MirroredElemLabels >: scala.*:["value", scala.Tuple$package.EmptyTuple] <: scala.*:["value", scala.Tuple$package.EmptyTuple]
7+
type MirroredElemHasDefaults >: scala.*:[false, scala.Tuple$package.EmptyTuple] <: scala.*:[false, scala.Tuple$package.EmptyTuple]
78
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import scala.deriving._
2+
import scala.annotation.experimental
3+
import scala.quoted._
4+
5+
import MirrorOps.*
6+
7+
object Test extends App:
8+
9+
case class WithDefault(x: Int, y: Int = 1)
10+
assert(overridesDefaultArgument[WithDefault])
11+
12+
case class WithoutDefault(x: Int)
13+
assert(!overridesDefaultArgument[WithoutDefault])

tests/run/mirror-defaultArgument/test.scala renamed to tests/run/mirror-defaultArgument.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
import scala.deriving._
22
import scala.annotation.experimental
3-
import scala.quoted._
4-
5-
import MirrorOps.*
63

74
object Test extends App:
85

9-
case class WithoutDefault(x: Int)
10-
assert(!overridesDefaultArgument[WithoutDefault])
11-
12-
136
case class WithDefault(x: Int, y: Int = 1)
14-
assert(overridesDefaultArgument[WithDefault])
15-
167
val m = summon[Mirror.Of[WithDefault]]
178
assert(m.defaultArgument(1) == 1)
18-
199
try
2010
m.defaultArgument(0)
2111
throw IllegalStateException("There should be no default argument")

0 commit comments

Comments
 (0)