-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Named type error messages to new format #3419
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.
Thanks for the contribution! Just a couple of remarks
case class UndefinedNamedTypeArgument(undefinedName: Name, definedNames: List[Name])(implicit ctx: Context) | ||
extends Message(UndefinedNamedTypeArgumentID) { | ||
val kind = "Syntax" | ||
val msg = hl"Type parameter $undefinedName is undefined. Expected one of ${definedNames.mkString(", ")}." |
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.
definedNames.map(_.show).mkString(", ")
assertEquals("C", n1.show) | ||
assertEquals("A"::"B"::Nil, l1.map(_.show)) | ||
assertEquals("C", n2.show) | ||
assertEquals("A"::"B"::Nil, l2.map(_.show)) |
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.
val tpParams = List("A", "B")
assertEquals(tpParams, l1.map(_.show))
assertEquals(tpParams, l2.map(_.show))
@@ -1865,4 +1865,18 @@ object messages { | |||
|Excluded from this rule are methods that are defined in Java or that override methods defined in Java.""" | |||
} | |||
} | |||
|
|||
case class DuplicateNamedTypeArgument(name: Name)(implicit ctx: Context) |
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.
Rename to DuplicateNamedTypeParameter
val explanation = "" | ||
} | ||
|
||
case class UndefinedNamedTypeArgument(undefinedName: Name, definedNames: List[Name])(implicit ctx: Context) |
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.
Rename to UndefinedNamedTypeParameter
MissingEmptyArgumentListID | ||
MissingEmptyArgumentListID, | ||
DuplicateNamedTypeArgumentID, | ||
UndefinedNamedTypeArgumentID |
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.
Rename DuplicateNamedTypeParameterID
and UndefinedNamedTypeParameterID
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.
LGTM. Thanks!
Part of #1589.
Changes error messages for named type parameters to use new format (with tests).