You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following code an implicit conversion gets applied even though it is not required. The code works correctly when a full function name (including package) is used.
objectMain {
defmain(args: Array[String]) {
importpkg._valp0=newPrivateI(newClue)
println("I was given a clue, and found a "+ p0.found +".")
valp1=newPoliceman(newClue)
println("I was given a clue, and found a "+ p1.found +".")
}
}
packagepkg {
classCluetraitRedtraitHerring[T]
classRedHerringextendsHerring[Red]
classPrivateI(valclue:Clue) {
deffound= find(clue)
}
classPoliceman(valclue:Clue) {
deffound= pkg.find(clue)
}
}
packageobjectpkg {
implicitdefconvert(s: Clue) :RedHerring=newRedHerringdeffind(clue: Clue) :String= clue.getClass.getSimpleName
deffind(fish: Herring[_]) :String= fish.getClass.getSimpleName
}
=== What is the expected behavior? ===
"find(Clue)" should be called both times.
=== What do you see instead? ===
An implicit conversion gets applied and "find(Herring[_])" is called instead.
=== What versions of the following are you using? ===
Scala: 2.9.0.final
Java: 1.6.0_24
Operating system: Arch64
The text was updated successfully, but these errors were encountered:
In the following code an implicit conversion gets applied even though it is not required. The code works correctly when a full function name (including package) is used.
=== What is the expected behavior? ===
"find(Clue)" should be called both times.
=== What do you see instead? ===
An implicit conversion gets applied and "find(Herring[_])" is called instead.
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: