From 6015a54812a5003933da7924f74ac8bde3adfdff Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 20 Jul 2012 16:39:11 +0200 Subject: 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 --- test/files/pos/t1832.scala | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/files/pos/t1832.scala (limited to 'test/files/pos') 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 -- cgit v1.2.3