Skip to content

Allow end given as an end marker #7568

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 8 commits into from
Nov 18, 2019
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 17, 2019

Allow end given as an end marker for anonymous givens.
These could not have an end marker before.

Based on #7557.

Comparing the wrapper objects for specificity is not enough; we should also
look at the resolved methods themselves.
Disallow the previous syntax
```
  given (x: T)
    ... extension methods
```
Require instead
```
  given extension (x: T)
    ... extension methods
```
This avoids the confusion with given instances for types in parentheses and makes
i7515.scala compile. To allow building with 0.20rc1, we allow the old extension syntax
if it comes with a name. E.g. the following is still allowed, but will be dropped
once we have bootstrapped with this commit present.
```
  given ops: (x: T)
    ... extension methods
```
Allow `end given` as an end marker for anonymous givens.
These could not have an end marker before.

Based on scala#7557.
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.

LGTM

@odersky odersky merged commit 7beb507 into scala:master Nov 18, 2019
@odersky odersky deleted the add-end-given branch November 18, 2019 21:41
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