Skip to content

Commit bbcc700

Browse files
griggtsmarter
authored andcommitted
Test case for #12927
1 parent 84c2b11 commit bbcc700

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

sbt-test/opaques/i12927/build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
scalaVersion := sys.props("plugin.scalaVersion")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
object Foo:
2+
opaque type BlaBla[+T, D] = Int
3+
extension [T, D](token: BlaBla[T, D]) def data: D = ???
4+
5+
//To cause the crash, after initial clean compilation
6+
//replace `???` with `value.data` to cause the compiler crash
7+
def foo[W <: Int](value: Bar.BlaBla[W]): Unit = value.data
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object Bar:
2+
type Fuzzy[W <: Int] = Int
3+
opaque type BlaBla[W <: Int] <: Foo.BlaBla[Fuzzy[W], Int] =
4+
Foo.BlaBla[Fuzzy[W], Int]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
object Foo:
2+
opaque type BlaBla[+T, D] = Int
3+
extension [T, D](token: BlaBla[T, D]) def data: D = ???
4+
5+
//To cause the crash, after initial clean compilation
6+
//replace `???` with `value.data` to cause the compiler crash
7+
def foo[W <: Int](value: Bar.BlaBla[W]): Unit = ??? //value.data

sbt-test/opaques/i12927/test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> compile
2+
$ copy-file changes/Foo.scala src/main/scala/Foo.scala
3+
> compile

0 commit comments

Comments
 (0)