summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-11-25 14:33:51 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-11-25 14:33:51 -0800
commit554f1bbf91084cb501584971f2c90809c819c0a5 (patch)
tree61bfca8105e1c15d1a1f835af8b41598e770fbc6 /test/files/neg
parent5f21394cd42dbd93e34320e09403cd66bdad3a96 (diff)
parenta5e24768f26bb2d28c7610ff5a184b0c65f56c55 (diff)
downloadscala-554f1bbf91084cb501584971f2c90809c819c0a5.tar.gz
scala-554f1bbf91084cb501584971f2c90809c819c0a5.tar.bz2
scala-554f1bbf91084cb501584971f2c90809c819c0a5.zip
Merge pull request #3130 from retronym/ticket/7967-2
SI-7967 Account for type aliases in self-type checks
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t7967.check9
-rw-r--r--test/files/neg/t7967.scala9
2 files changed, 18 insertions, 0 deletions
diff --git a/test/files/neg/t7967.check b/test/files/neg/t7967.check
new file mode 100644
index 0000000000..cde950dcdf
--- /dev/null
+++ b/test/files/neg/t7967.check
@@ -0,0 +1,9 @@
+t7967.scala:6: error: illegal inheritance;
+ self-type C does not conform to C's selftype C with B
+ new C {} // fails
+ ^
+t7967.scala:8: error: illegal inheritance;
+ self-type Test.CC does not conform to Test.CC's selftype Test.CC
+ new CC {} // should fail, doesn't
+ ^
+two errors found
diff --git a/test/files/neg/t7967.scala b/test/files/neg/t7967.scala
new file mode 100644
index 0000000000..4f13347948
--- /dev/null
+++ b/test/files/neg/t7967.scala
@@ -0,0 +1,9 @@
+
+trait B
+trait C {self: B =>}
+
+object Test {
+ new C {} // fails
+ type CC = C
+ new CC {} // should fail, doesn't
+}