-
Notifications
You must be signed in to change notification settings - Fork 21
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
Cannot create an instance of the case class with some encoded field names #10825
Comments
W/a for this scalac bug is to move a definition of the field with encoded chars (
|
// The constructor parameter with given name. This means the parameter
// has given name, or starts with given name, and continues with a `$` afterwards.
def parameterNamed(name: Name): Symbol = {
def matchesName(param: Symbol) = param.name == name || param.name.startsWith(name + nme.NAME_JOIN_STRING) // nme.NAME_JOIN_STRING = "$"
primaryConstrParams filter matchesName match {
case Nil => abort(name + " not in " + primaryConstrParams)
case p :: _ => p
} More fallout from using |
Probably the same problem as #10625 where Constructors looks at prefixes. |
Another symptom #8831 |
@hrhino should this and 10625 also be closed in favor of 8831 as an umbrella issue? Asking in case you understand any nuances. I haven't re-read the issues. |
Also, what happened to the touted GitHub "duplicate of" feature from a few months ago? Did it get rebased away? |
Duplicate of #8831 |
Woah, I just noticed that when @dwijnand says "duplicate of #...", github listens! |
It looks like a bug in scalac and affects case classes which have 2 fields where name of one is a prefix for the another name that contains a character that should be encoded immediately after the prefix (like
o
ando-o
).For 2.11.12 I got a compilation error:
While in 2.12 it fails in the runtime during a call of the constructor:
Code to reproduce:
The text was updated successfully, but these errors were encountered: