summaryrefslogtreecommitdiff
path: root/test/files/pos/t7596b
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/t7596b
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/t7596b')
-rw-r--r--test/files/pos/t7596b/A.scala10
-rw-r--r--test/files/pos/t7596b/B.scala6
2 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/t7596b/A.scala b/test/files/pos/t7596b/A.scala
new file mode 100644
index 0000000000..65c1bc56ef
--- /dev/null
+++ b/test/files/pos/t7596b/A.scala
@@ -0,0 +1,10 @@
+trait H2Driver{
+ abstract class Table[T]
+}
+
+object Config {
+ val driver : H2Driver = ???
+ def driver(app: Any): H2Driver = ???
+}
+
+class Sites extends Config.driver.Table[String]
diff --git a/test/files/pos/t7596b/B.scala b/test/files/pos/t7596b/B.scala
new file mode 100644
index 0000000000..cbcf149c23
--- /dev/null
+++ b/test/files/pos/t7596b/B.scala
@@ -0,0 +1,6 @@
+class DAOBase[E]{
+ type TableType <: Config.driver.Table[E]
+}
+class SitesDAO extends DAOBase[String]{
+ type TableType = Sites
+}