Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
7 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ok! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
scales.xml.CCE_Test.main(args) | ||
println("ok!") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package scaley | ||
|
||
package object funny { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package scales | ||
|
||
package object xml extends PullIteratees |