summaryrefslogtreecommitdiff
path: root/test/files/pos/t1832.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-07-20 16:39:11 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-07-20 16:41:40 +0200
commit6015a54812a5003933da7924f74ac8bde3adfdff (patch)
tree0eef0150df7cdcbe2b25da11c4a7723ea71a3070 /test/files/pos/t1832.scala
parent8b0259f8f4f2773560efa985142eaf167f597a24 (diff)
downloadscala-6015a54812a5003933da7924f74ac8bde3adfdff.tar.gz
scala-6015a54812a5003933da7924f74ac8bde3adfdff.tar.bz2
scala-6015a54812a5003933da7924f74ac8bde3adfdff.zip
SI-1832 consistent symbols in casedef's pattern&body
the only change to typedBind in this commit (beyond refactoring to keep my eyes from bleeding), is explained by the added comment: have to imperatively set the symbol for this bind to keep it in sync with the symbols used in the body of a case when type checking a case we imperatively update the symbols in the body of the case those symbols are bound by the symbols in the Binds in the pattern of the case, so, if we set the symbols in the case body, but not in the patterns, then re-type check the casedef (for a second try in typedApply for example -- SI-1832), we are no longer in sync: the body has symbols set that do not appear in the patterns since body1 is not necessarily equal to body, we must return a copied tree, but we must still mutate the original bind
Diffstat (limited to 'test/files/pos/t1832.scala')
-rw-r--r--test/files/pos/t1832.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/files/pos/t1832.scala b/test/files/pos/t1832.scala
new file mode 100644
index 0000000000..c7b1ffb838
--- /dev/null
+++ b/test/files/pos/t1832.scala
@@ -0,0 +1,8 @@
+trait Cloning {
+ trait Foo
+ def fn(g: Any => Unit): Foo
+
+ implicit def mkStar(i: Int) = new { def *(a: Foo): Foo = null }
+
+ val pool = 4 * fn { case ghostSYMBOL: Int => ghostSYMBOL * 2 }
+} \ No newline at end of file