aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/skolemize.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/neg/skolemize.scala')
-rw-r--r--tests/neg/skolemize.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/neg/skolemize.scala b/tests/neg/skolemize.scala
new file mode 100644
index 000000000..77045cfc4
--- /dev/null
+++ b/tests/neg/skolemize.scala
@@ -0,0 +1,13 @@
+class Inv[T]
+
+class Foo {
+ val foo: Inv[this.type] = new Inv[this.type]
+}
+object Test {
+ def test: Unit = {
+ val e1 = new Foo
+ val f1: Inv[Foo] = e1.foo // error
+ var e2 = new Foo
+ val f2: Inv[Foo] = e2.foo // error
+ }
+}