New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overloading in package object #1987
Comments
Imported From: https://issues.scala-lang.org/browse/SI-1987?orig=1
|
@okomok said: |
@dubochet said: |
@paulp said: |
Erkki Lindpere (villane) said: File1: } File2: class Client { |
Erkki Lindpere (villane) said: File1.scala
File2.scala
|
Harrison Klaperman (hlklaperman) said:
The above file compiles with no errors. In another file we have the exact same method
The compiler reports the following errors:
I think this is a pretty big bug in package objects. |
Harrison Klaperman (hlklaperman) said: |
@paulp said:
etc. |
@retronym said: |
Harrison Klaperman (hlklaperman) said: |
@non said (edited on Jan 13, 2012 6:21:47 AM UTC):
Output:
In the wild it takes a moment to notice that this is going on because the Long values will get coerced into Doubles. Currently scala.math would hit this bug in a big way if it needed to use its own functions (e.g. abs). I noticed this when writing a similar "math package". |
@paulp said: |
@paulp said: |
@non said: |
Chris (chris) said (edited on Aug 22, 2012 9:54:29 PM UTC): The code will "compile" but it generates CCEing byte code: scaley.funny.package$ cannot be cast to scales.xml.PullIteratees which is true, but for some reason the compiler generates it. The code is here: https://github.com/chris-twiner/scalesXml/tree/cdeb3a7e04d15cf77c9fda4d406c3eb403920a18 4 very small files plus the build.sbt. clean + run and you'll see the cce. I've commented in the code what can stop the cce, any of which forces
|
@paulp said: |
Chris (chris) said: |
@adriaanm said: |
Trivial overloading resolution in package object doesn't work?
The text was updated successfully, but these errors were encountered: