summaryrefslogtreecommitdiff
path: root/test/files/pos/t7596c
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-06-19 21:34:51 +0200
committerJason Zaugg <jzaugg@gmail.com>2014-11-06 18:16:32 +1000
commit652abbacf7b913ef87474df4bcce4fe90aec24a1 (patch)
treee52defb65f319c48d24db9e14c58237b90aad652 /test/files/pos/t7596c
parentcd50464cd019bc6a489a72b98293c30b91352bab (diff)
downloadscala-652abbacf7b913ef87474df4bcce4fe90aec24a1.tar.gz
scala-652abbacf7b913ef87474df4bcce4fe90aec24a1.tar.bz2
scala-652abbacf7b913ef87474df4bcce4fe90aec24a1.zip
SI-7596 Curtail overloaded symbols during unpickling
In code like: object O { val x = A; def x(a: Any) = ... } object P extends O.x.A The unpickler was using an overloaded symbol for `x` in the parent type of `P`. This led to compilation failures under separate compilation. The code that leads to this is in `Unpicklers`: def fromName(name: Name) = name.toTermName match { case nme.ROOT => loadingMirror.RootClass case nme.ROOTPKG => loadingMirror.RootPackage case _ => adjust(owner.info.decl(name)) } This commit filters the overloaded symbol based its stability unpickling a singleton type. That seemed a slightly safer place than in `fromName`.
Diffstat (limited to 'test/files/pos/t7596c')
-rw-r--r--test/files/pos/t7596c/A_1.scala11
-rw-r--r--test/files/pos/t7596c/B_2.scala9
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/t7596c/A_1.scala b/test/files/pos/t7596c/A_1.scala
new file mode 100644
index 0000000000..3e366df477
--- /dev/null
+++ b/test/files/pos/t7596c/A_1.scala
@@ -0,0 +1,11 @@
+trait Driver {
+ abstract class Table
+}
+
+object Config {
+ val driver : Driver = ???
+ val driverUniqueName: driver.type = driver
+ def driver(a: Any) = ???
+}
+
+object Sites extends Config.driver.Table
diff --git a/test/files/pos/t7596c/B_2.scala b/test/files/pos/t7596c/B_2.scala
new file mode 100644
index 0000000000..33da68c1ff
--- /dev/null
+++ b/test/files/pos/t7596c/B_2.scala
@@ -0,0 +1,9 @@
+object Test {
+ locally {
+ Sites: Config.driver.Table
+ }
+}
+
+// This variation worked by avoiding referring to the
+// overloaded term `Config.driver` in the parent type of
+// Sites \ No newline at end of file