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
@lrytz said:
in respect of language uniformity we decided not to fix this one - since it's a problem of interoperability with frameworks, we think it should not be fixed at the language level.
workarounds: repeat a default, or abstract over one, or put one default int the zero-argument constructor
= problem =
For a lot of java libraries or frameworks, a default no-args constructor for a class is required. Some examples:
If you have a class with only optional arguments (like class A(i : Int = 0)), you'd expect it would work in such a situation.
There is also no easy way to access default values for constructors from java.
= analysis =
There is really no idiomatic way to create classes that adhere to such an interface in scala, see: http://stackoverflow.com/questions/4045863/scala-extra-no-arg-constructor-plus-default-constructor-parameters
It is not a very common use case, but it would improve java-scala interop by fixing this.
= enhancement recommendation =
There are two ways to fix this:
The text was updated successfully, but these errors were encountered: