summaryrefslogtreecommitdiff
path: root/test/files/neg/saito.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/saito.scala')
-rw-r--r--test/files/neg/saito.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/neg/saito.scala b/test/files/neg/saito.scala
new file mode 100644
index 0000000000..a8bcc79d65
--- /dev/null
+++ b/test/files/neg/saito.scala
@@ -0,0 +1,14 @@
+class B {}
+class A requires B {
+ def m(): B = {
+ this
+ }
+}
+
+object Exec{
+ def main(args: Array[String]): Unit = {
+ val a: A = new A; // should not be allowed
+ val b: B = a.m();
+ }
+}
+