Skip to content

Commit

Permalink
Test mirror default argument source dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneFlesselle committed Oct 19, 2023
1 parent 4c4b483 commit f163bdd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sbt-test/source-dependencies/mirror-product/MyProduct.scala
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
case class MyProduct(x: Int)
case class WillGetDefault(x: Int)
case class WillChangeDefault(x: Int = 1)
2 changes: 2 additions & 0 deletions sbt-test/source-dependencies/mirror-product/Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ transparent inline def foo[T](using m: Mirror.Of[T]): Int =

@main def Test =
assert(foo[MyProduct] == 2)
assert(summon[Mirror.Of[WillGetDefault]].defaultArgument(0) == 1)
assert(summon[Mirror.Of[WillChangeDefault]].defaultArgument(0) == 2)
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
case class MyProduct(x: Int, y: String)
case class WillGetDefault(x: Int = 1)
case class WillChangeDefault(x: Int = 2)

0 comments on commit f163bdd

Please sign in to comment.