From 8a1f85d521399be9141db1da2b0d2bd67cfb39e9 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 4 Dec 2012 00:24:42 +0100 Subject: SI-6535 Step back from the precipice of a cycle Adding any non-local parent to WrapAsScala will trigger a valid cyclic reference error. By moving the import of `Wrapper._` inside `WrapAsScala` and `WrapAsJava`, it is not in scope when typing the parents of those, and we avoid the cycle. Adds a test case to show the essense of the promiscious mutual imports that triggers this. --- test/files/neg/t6535.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/files/neg/t6535.scala (limited to 'test/files/neg/t6535.scala') diff --git a/test/files/neg/t6535.scala b/test/files/neg/t6535.scala new file mode 100644 index 0000000000..30a750311c --- /dev/null +++ b/test/files/neg/t6535.scala @@ -0,0 +1,15 @@ +object As { + import Bs.B._ + + object A + extends scala.AnyRef // needed for the cycle; + // replacing with a locally defined closs doesn't + // hit the locked import and hence doesn't cycle. +} + +object Bs { + import As.A._ + + object B + extends scala.AnyRef // scala.Immutable, ... +} -- cgit v1.2.3