-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add an error message class for a case where a trait is expected #3465
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
"""class A | ||
|class B | ||
| | ||
|val a = new A with B // will fail with a compile error - B is not a trait""" |
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.
You should stripMargin
here
"""class A | ||
|trait B | ||
| | ||
|val a = new A with B // compiles normally""" |
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.
You should stripMargin
here
@@ -1888,4 +1888,32 @@ object messages { | |||
} | |||
val explanation = "A statement is either an import, a definition or an expression." | |||
} | |||
|
|||
case class TraitIsExpected(tref: TypeRef)(implicit ctx: Context) extends Message(TraitIsExpectedID) { |
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.
I would rather pass the symbol instead of the TypeRef
@allanrenucci all done. PTAL. |
It seems that the CLA check is still pending. Is there anything I can do to make it pass? 😟 |
Sometimes the CLA stalls |
This PR is related to #1589. Specifically, it adds a new error message class for the following case -
Checking.scala:551