diff --git a/tests/neg/i6225.scala b/tests/neg/i6225.scala new file mode 100644 index 000000000000..6602f8ec928f --- /dev/null +++ b/tests/neg/i6225.scala @@ -0,0 +1,23 @@ +object O1 { + type A[X] = X + opaque type T = A +} + +object O2 { + opaque type A[X] = X + object A { + opaque type T = A + } +} + +object O3 { + opaque type R[X] = R[X] // error +} + +object O4{ + opaque type T[X] = Any +} + +object O5{ + opaque type T[X] = Nothing +} \ No newline at end of file diff --git a/tests/pos/i6224.scala b/tests/pos/i6224.scala new file mode 100644 index 000000000000..e7b24dfaa2e3 --- /dev/null +++ b/tests/pos/i6224.scala @@ -0,0 +1,6 @@ +object O { + opaque type T = Int + object T { + opaque type T = Int + } +}