-
Notifications
You must be signed in to change notification settings - Fork 21
Scala class singleton with non-default constructor parameters #10537
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
Comments
hi, and thanks for the report. but, this bug tracker isn't the place for things where you think maybe it might be a bug but you're not really sure. those should stay on Stack Overflow or https://users.scala-lang.org. come here once you're 90% sure it's a bug. some hints for achieving a minimal yet complete bug report here:
|
Hi @SethTisue! Thank you for pointing me. I am not an experienced Scala community participator. The most relates thing that I found in similar issues is the following comment:
But I have not understood the resolution from any of the tickets. My question is: should the error message be changed? It seems that suggestion Thank you! |
let's discuss in one of the aforementioned forums |
FYI, @SethTisue quote from users.scala-lang.org (@yawaramin13m):
|
I was in the area of that code and took a look. It notices the error when looking for aliases of super ctor args. |
I decided to leave this question here also (maybe it is some kind of defect). Just because it can be lost in StackOverflow.
Link to question: Scala class singleton with non-default constructor parameters
Question:
I have already read about issues with objects inheriting from companion classes.
For example:
But I have a bit different issue (I am not sure that it is a bug)
I have the following code:
Note, that I am use variable defined in scope of companion object and then pass it to super's constructor.
I am getting the following compilation error:
Other variants that I have tried:
Call by name:
Named argument:
Both of them:
Some environment details:
java version "1.8.0_144"
javac 1.8.0_144
Scala code runner version 2.12.3
Scala compiler version 2.12.3
Darwin ***.local 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64
The text was updated successfully, but these errors were encountered: