Skip to content

Fix #6795: Print flagString #6797

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

Merged
merged 3 commits into from
Jul 3, 2019
Merged

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki self-assigned this Jul 3, 2019
@@ -284,7 +284,7 @@ class Namer { typer: Typer =>
case _ => (flags.isTermFlags, flags.toTermFlags, "value")
}
if (!ok)
ctx.error(i"modifier(s) `$flags' incompatible with $kind definition", tree.sourcePos)
ctx.error(i"modifier(s) `${flags.flagsString}' incompatible with $kind definition", tree.sourcePos)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be:

`${flags.flagsString}`

That is, a backtick at the end rather than a single quote?

@@ -1504,7 +1504,7 @@ object messages {
case class AbstractMemberMayNotHaveModifier(sym: Symbol, flag: FlagSet)(
implicit ctx: Context)
extends Message(AbstractMemberMayNotHaveModifierID) {
val msg: String = em"""${hl("abstract")} $sym may not have `$flag' modifier"""
val msg: String = em"""${hl("abstract")} $sym may not have `${flag.flagsString}' modifier"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing with the backtick here

-- [E083] Syntax Error: tests/neg/i6795-b.scala:1:11 -------------------------------------------------------------------
1 |sealed def y: Int = 1 // error
| ^
| Modifier(s) sealed not allowed for method
Copy link
Contributor

@anatoliykmetyuk anatoliykmetyuk Jul 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be consistent in how we quote these modifiers. If erased is quoted with backticks, sealed should be as well

@anatoliykmetyuk anatoliykmetyuk merged commit 355bcc0 into scala:master Jul 3, 2019
@anatoliykmetyuk anatoliykmetyuk deleted the fix-#6795 branch July 3, 2019 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants