Skip to content

Commit

Permalink
Add generic record run test.
Browse files Browse the repository at this point in the history
  • Loading branch information
yilinwei committed Feb 9, 2024
1 parent 406c039 commit 7b44500
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/run-java16+/java-records/R2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public record R2<T>(T t, int i) {}
7 changes: 7 additions & 0 deletions tests/run-java16+/java-records/Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ object Test:

val R1(i) = r1
assert(i == 42)

val r2 = R2("foo", 9)
val R2(s, _) = r2
assert(s == "foo")

r2 match
case R2(_, i) => assert(i == 9)

0 comments on commit 7b44500

Please sign in to comment.