Skip to content

Improve compiler messages #4443

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
May 2, 2018
Merged

Improve compiler messages #4443

merged 3 commits into from
May 2, 2018

Conversation

ingarabr
Copy link
Contributor

@ingarabr ingarabr commented May 2, 2018

Related to #1589

Copy link
Member

@dottybot dottybot left a 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! ☀️

@@ -358,6 +350,8 @@ object Checking {
fail(AbstractOverrideOnlyInTraits(sym))
if (sym.is(Trait) && sym.is(Final))
fail(TraitsMayNotBeFinal(sym))
if (sym.hasAnnotation(defn.TailrecAnnot) && !sym.is(Method | ModuleVal) )
Copy link
Member

Choose a reason for hiding this comment

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

Style: write )) instead of ) )
Maybe add a comment: // Skip ModuleVal since the annotation will also be on the ModuleClass

implicit val ctx: Context = ictx
assertMessageCount(4, messages)

val tailRegMessages = messages.map{ case m :TailrecNotApplicable => m.symbolKind}.toSet
Copy link
Member

Choose a reason for hiding this comment

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

Style: case m:

ingarabr added 2 commits May 2, 2018 16:57
Now the compiler will give compile errors if the annotation is
used on other kinds then methods.
@ingarabr ingarabr force-pushed the compiler-messages branch from 0628582 to e063257 Compare May 2, 2018 14:57
@smarter smarter merged commit d0f7846 into scala:master May 2, 2018
@ingarabr ingarabr deleted the compiler-messages branch May 2, 2018 19:53
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.

3 participants