-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Combines modifiers not allowed with type, and combinations.This also simplifies logic. Adds more detail to explanation #2807
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Have an awesome day! ☀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor nitpicks otherwise LGTM
} | ||
} | ||
|
||
private def getPrintableTypeFromFlagSet(flag: FlagSet) = | ||
Map(Trait -> "trait", Method -> "method", Mutable -> "variable").get(flag) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this method is only used by addFlag
, I would nest it in the method like:
def addFlag(mods: Modifiers, flag: FlagSet): Modifiers = {
def getPrintableTypeFromFlagSet(flag: FlagSet) =
Map(Trait -> "trait", Method -> "method", Mutable -> "variable").get(flag)
if (compatible(mods.flags, flag)) mods | flag
else {
syntaxError(ModifiersNotAllowed(mods.flags, getPrintableTypeFromFlagSet(flag)))
Modifiers(flag)
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely
| `lazy' values | ||
| AccessModifier ::= (`private' | `protected') [AccessQualifier] methods, classes | ||
| AccessQualifier ::= `[' (id | `this') `]' | ||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a copy of the syntax here might be nice, but it'd be better if we could link to the spec (we could open an issue for this instead).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense rather than duplicating maintenance effort
@felixmulder can someone press merge 😄 |
Of course, thanks! 🎉 |
No description provided.