We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
object Main { def main(args: Array[String]) { class C val z: C = classOf.newInstance() //NPE ?! val n: C = classOf[Nothing].newInstance() //InstantiationException, It's ok val x: C = classOf[C].newInstance() //Works, It's ok } }
According to specification classOf generic parameter should be C (local type inference from expected type).
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-4871?orig=1 Reporter: @Alefas Affected Versions: 2.9.0-1
Sorry, something went wrong.
@paulp said: See also #1754.
@adriaanm said: Expecting a report from Paul to further the discussion.
@paulp said:
scala> val z: Class[C] = classOf z: Class[C] = null scala> val z: Class[C] = classOf[C] z: Class[C] = class C
I guess that sums it up.
@paulp said: Fixed in bba3b00cf7 .
paulp
No branches or pull requests
According to specification classOf generic parameter should be C (local type inference from expected type).
The text was updated successfully, but these errors were encountered: