summaryrefslogtreecommitdiff
path: root/test/files/neg/t5361.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-12-04 20:19:01 +0100
committerJason Zaugg <jzaugg@gmail.com>2012-12-04 20:19:01 +0100
commit327083df40d1854f28c00983aed5734fa6a7e6f9 (patch)
tree7c73e838f328014a79c36d71dde35b0fba3b3963 /test/files/neg/t5361.scala
parentfd57069a3a49de1757a518b573a0cd8cb98bbbd5 (diff)
downloadscala-327083df40d1854f28c00983aed5734fa6a7e6f9.tar.gz
scala-327083df40d1854f28c00983aed5734fa6a7e6f9.tar.bz2
scala-327083df40d1854f28c00983aed5734fa6a7e6f9.zip
SI-5361 Avoid cyclic type with malformed refinement
The statement `val x = this` in the refinment type: (new {}): {val x = this} is lazily typechecked, in order to, according to the comment in `typedRefinment, "avoid cyclic reference errors". But the approximate type used ends up with: Refinment@1( parents = [...] decls = { val x: Refinement@1 }) This commit eagerly checks that there is no term definitions in type refinments, rather than delaying this. This changes the error message for SI-3614.
Diffstat (limited to 'test/files/neg/t5361.scala')
-rw-r--r--test/files/neg/t5361.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/files/neg/t5361.scala b/test/files/neg/t5361.scala
new file mode 100644
index 0000000000..1705c09df3
--- /dev/null
+++ b/test/files/neg/t5361.scala
@@ -0,0 +1,3 @@
+class A {
+ val x : { val self = this } = new { self => }
+}