From 70ed23d58f9dd2d198250d2a889b60c88e39f59a Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 15 Jan 2015 11:33:54 +1000 Subject: SI-9089 Another REPL/FSC + specialization bug fix The enclosed test case stopped working in 2.11.5 on the back of https://github.com/scala/scala/pull/4040. The key change was that we ran all post-typer info transformers on each run of the compiler, rather than trying to reuse the results of the previous run. In that patch, I noticed one place [1] in specialization that aggressively entered specialized members into the owning scope, rather than relying on `transformInfo` to place the new members in the scope of the newly created element of the info history. I made that change after noticing that this code could actually mutated scopes of specializaed types at the parser phase, which led to fairly obscure failures. This bug is another one of these obscure failures, and has the same root cause. We effectively "double specialiaze" Function0, which trips an assertion when `method apply$mcI$sp` is found twice in a scope. I have found another spot that was directly manipulating the scope, and removed the offending code. [1] https://github.com/scala/scala/pull/4040#commitcomment-8531516 --- test/files/res/t9089/A.scala | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/files/res/t9089/A.scala (limited to 'test/files/res/t9089/A.scala') diff --git a/test/files/res/t9089/A.scala b/test/files/res/t9089/A.scala new file mode 100644 index 0000000000..bccf269639 --- /dev/null +++ b/test/files/res/t9089/A.scala @@ -0,0 +1 @@ +object O { def f(x: => Int): Int = x } -- cgit v1.2.3