From fcf2b29010fd20acb3c27204e4dd9e795eabe00c Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 22 Aug 2012 21:55:26 +0200 Subject: Improved fix for SI-1987, overloading in package objects. When reformulating an errant package object overload, don't forget to fully qualify it lest you trade one error for another. --- test/files/run/t1987b.check | 1 + test/files/run/t1987b/PullIteratees.scala | 17 +++++++++++++++++ test/files/run/t1987b/a.scala | 6 ++++++ test/files/run/t1987b/cce_test.scala | 15 +++++++++++++++ test/files/run/t1987b/pkg1.scala | 4 ++++ test/files/run/t1987b/pkg2.scala | 3 +++ 6 files changed, 46 insertions(+) create mode 100644 test/files/run/t1987b.check create mode 100644 test/files/run/t1987b/PullIteratees.scala create mode 100644 test/files/run/t1987b/a.scala create mode 100644 test/files/run/t1987b/cce_test.scala create mode 100644 test/files/run/t1987b/pkg1.scala create mode 100644 test/files/run/t1987b/pkg2.scala (limited to 'test/files') diff --git a/test/files/run/t1987b.check b/test/files/run/t1987b.check new file mode 100644 index 0000000000..68d4b10e12 --- /dev/null +++ b/test/files/run/t1987b.check @@ -0,0 +1 @@ +ok! diff --git a/test/files/run/t1987b/PullIteratees.scala b/test/files/run/t1987b/PullIteratees.scala new file mode 100644 index 0000000000..a5a3e65d8f --- /dev/null +++ b/test/files/run/t1987b/PullIteratees.scala @@ -0,0 +1,17 @@ +package scales.xml + +trait PullType +class QName +trait RetUrn[T] + +/** + * Iteratees related to pull parsing + */ +trait PullIteratees { + /** + * Without the overload it doesn't trigger the CCE, even though its + * not used + */ + def iterate(path: List[QName], xml: String): RetUrn[String] = null + def iterate(path: List[QName], xml: Iterator[PullType]): RetUrn[String] = null +} diff --git a/test/files/run/t1987b/a.scala b/test/files/run/t1987b/a.scala new file mode 100644 index 0000000000..c1be5fe3e0 --- /dev/null +++ b/test/files/run/t1987b/a.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + scales.xml.CCE_Test.main(args) + println("ok!") + } +} diff --git a/test/files/run/t1987b/cce_test.scala b/test/files/run/t1987b/cce_test.scala new file mode 100644 index 0000000000..4f9acf0264 --- /dev/null +++ b/test/files/run/t1987b/cce_test.scala @@ -0,0 +1,15 @@ +package scales.xml +//import scales.xml._ // using another pacakge and importing doesn't CCE + +object CCE_Test { + def main(args: Array[String]): Unit = { + // without the import it doesn't trigger the CCE + import scaley.funny._ + + val pull = null.asInstanceOf[Iterator[PullType]] + val LogEntries = null.asInstanceOf[List[QName]] + // fully qualify with scales.xml. and it won't trigger it + iterate(LogEntries, + pull) + } +} diff --git a/test/files/run/t1987b/pkg1.scala b/test/files/run/t1987b/pkg1.scala new file mode 100644 index 0000000000..6e749fc6b3 --- /dev/null +++ b/test/files/run/t1987b/pkg1.scala @@ -0,0 +1,4 @@ +package scaley + +package object funny { +} diff --git a/test/files/run/t1987b/pkg2.scala b/test/files/run/t1987b/pkg2.scala new file mode 100644 index 0000000000..38056a199e --- /dev/null +++ b/test/files/run/t1987b/pkg2.scala @@ -0,0 +1,3 @@ +package scales + +package object xml extends PullIteratees -- cgit v1.2.3