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
Incorrectly added BoxedUnit.UNIT to a no-parameter constructor call #4851
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4851?orig=1 |
Daniel Cardin (mrhightech) said: |
@paulp said: |
Daniel Cardin (mrhightech) said: the no-args constructor does NOT exist in the java class. But my understanding is that scalac converts the () to BoxedUnit.UNIT which satisfies the PropertyChangeSupport(Object o) constructor. Obviously that constructor is not what I am expected to be used... It is actually very misleading to someone using a Java API. I read the other thread and I think scalac should be more strict when using Java classes... if that is even identifiable to the compiler. |
@paulp said: |
Daniel Cardin (mrhightech) said: I'm having a hard time "selling" Scala to my programmers (strangely enough, the older guy is pushing on the younger ones... go figure). But a key point, and this is almost an understatement, is that the Java integration must be stellar. The same goes for a great IDE, and it's A "feature" like this makes Java integration risky. Please consider :) |
@paulp said: |
Daniel Cardin (mrhightech) said (edited on Jul 29, 2011 1:21:26 PM UTC): |
@paulp said: |
Commit Message Bot (anonymous) said: -Ywarn-adapted-args // also included in -Xlint The former warns when a () is inserted or an argument list is implicitly Certain particularly threatening scenarios are at minimum warned about |
@paulp said: |
Daniel Cardin (mrhightech) said: |
I have this piece of code
I realized that I used a constructor which is NOT present in the java class. How is that possible ? A decompile yielded:
So it seems the compiler tried to match the Object constructor with a default unit. Is this the proper behavior ?
How can a programmer know that this substitution is happening ?
The text was updated successfully, but these errors were encountered: