Skip to content

Remove NamedTermRef and NamedTypeRef #7001

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

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki self-assigned this Aug 6, 2019
@nicolasstucki nicolasstucki force-pushed the join-type-and-term-ref-api branch 3 times, most recently from 5317da0 to 303e05c Compare August 8, 2019 09:44
Make it closer to NamedTermRef extractor
@nicolasstucki nicolasstucki force-pushed the join-type-and-term-ref-api branch from 303e05c to 56c877c Compare August 8, 2019 11:09
@nicolasstucki nicolasstucki marked this pull request as ready for review August 8, 2019 12:36
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Nice refactoring, LGTM 👍

def unapply(typeOrBounds: TypeOrBounds) given (ctx: Context): Option[(Symbol, TypeOrBounds /* Type | NoPrefix */)] =
internal.matchTermRef_unapply(typeOrBounds)
def unapply(typeOrBounds: TypeOrBounds) given (ctx: Context): Option[(TypeOrBounds /* Type | NoPrefix */, String)] =
internal.matchTermRef(typeOrBounds).map(x => (x.qualifier, x.name))
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe return Symbol instead of Name --- programmers can easily get name from symbol.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The symbol is not part of the type structure. It is also more efficient to get the symbol directly with termSymbol rather than boxing it with the qualifier.

@nicolasstucki nicolasstucki merged commit fb99490 into scala:master Aug 8, 2019
@nicolasstucki nicolasstucki deleted the join-type-and-term-ref-api branch August 8, 2019 13:19
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.

2 participants