Skip to content

Conversation

DSouzaM
Copy link
Contributor

@DSouzaM DSouzaM commented Nov 1, 2017

Part of #1589.

Changes error messages for named type parameters to use new format (with tests).

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! ☀️

Copy link
Contributor

@allanrenucci allanrenucci left a 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(", ")}."
Copy link
Contributor

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))
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename DuplicateNamedTypeParameterID and UndefinedNamedTypeParameterID

Copy link
Contributor

@allanrenucci allanrenucci left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@allanrenucci allanrenucci merged commit cbb481c into scala:master Nov 2, 2017
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