Skip to content

Allow overloads between fields and methods for Java code #9116

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 1 commit into from
Jun 9, 2020

Conversation

smarter
Copy link
Member

@smarter smarter commented Jun 7, 2020

Fixes #7132.

@smarter smarter force-pushed the overload-field-meth branch from b11878f to 407d39d Compare June 7, 2020 11:35
@smarter smarter requested a review from odersky June 7, 2020 11:35
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM


/** Does this signature potentially clash with `that` ? */
def clashes(that: Signature)(implicit ctx: Context): Boolean =
matchDegree(that) == FullMatch

/** name.toString == "" or name.toString == "_" */
private def isWildcard(name: TypeName) = name.isEmpty || name == tpnme.WILDCARD
private def isWildcard(name: TypeName) = name == tpnme.WILDCARD
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 isWildcardOrEmpty

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually that commit removed the name.isEmpty check, so the current name of that method should be accurate.

"have matching parameter types."
case Signature.MatchDegree.FullMatch =>
case MethodNotAMethodMatch =>
"both have no parameters"
Copy link
Contributor

Choose a reason for hiding this comment

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

"neither has parameters"

@odersky odersky assigned smarter and unassigned odersky Jun 8, 2020
@smarter smarter force-pushed the overload-field-meth branch from 407d39d to 741685d Compare June 8, 2020 12:35
@smarter smarter merged commit fbafb72 into scala:master Jun 9, 2020
@smarter smarter deleted the overload-field-meth branch June 9, 2020 11:45
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.

java.nio.Buffer.isReadOnly method is not accessible
2 participants