diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-09-19 14:33:45 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-09-19 18:41:52 +1000 |
commit | 581e2c2455524123ed259adcfc66817f7fc04726 (patch) | |
tree | 825e083e0fe7f9ed912e199dc783c350ef96377f /test | |
parent | 46c81c6be94152f8ecf3b9cfc27ca1bb393b46f1 (diff) | |
download | scala-581e2c2455524123ed259adcfc66817f7fc04726.tar.gz scala-581e2c2455524123ed259adcfc66817f7fc04726.tar.bz2 scala-581e2c2455524123ed259adcfc66817f7fc04726.zip |
SI-9479 Fix regression w. inherited overloads in package object
One shouldn't base any decisions of the owner of an overloaded
symbol. Instead, the owner of each of the alternatives should
be considered.
This gotcha is super easy to forget, as I did with my change to
simplify the way we detect whether we need to add the `.package`
prefix to a tree.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t9479.scala | 15 | ||||
-rw-r--r-- | test/files/pos/t9479b.scala | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/files/pos/t9479.scala b/test/files/pos/t9479.scala new file mode 100644 index 0000000000..38eabf4338 --- /dev/null +++ b/test/files/pos/t9479.scala @@ -0,0 +1,15 @@ +trait Predefs { + def bridge(p: String): Unit = ??? + def bridge(p: Any): Unit = ??? +} + +package object molecule extends Predefs + +package molecule { + package process { + class Test { + def main(): Unit = bridge(null, null) + } + } +} + diff --git a/test/files/pos/t9479b.scala b/test/files/pos/t9479b.scala new file mode 100644 index 0000000000..5fc795a1fd --- /dev/null +++ b/test/files/pos/t9479b.scala @@ -0,0 +1,15 @@ +trait Predefs { + def bridge(p: String): Unit = ??? + def bridge(p: Any): Unit = ??? +} + +package object molecule extends Predefs + +package molecule { + package process { + class Test { + def main(): Unit = molecule.bridge(null, null) + } + } +} + |