-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add extension clauses #4085
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
Closed
Closed
Add extension clauses #4085
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
ab9aca1
Add opaque types: parsing & pickling
odersky 5e1b0a8
Store opaque info in annotation
odersky f5ef7b8
Keep track of opaque companion links
odersky 2403e06
Maintain companion aliases as GADT bounds
odersky f5060be
Test cases
odersky b7e7ef7
Allow for higher-kinded opaque types
odersky a79210b
Handle higher-kinded comparisons involving GADTs
odersky a11d1ad
Change companion detection scheme
odersky 4feb71d
Eliminate boxing for opaque types
odersky 1f985da
Make OpaqueAlias and LinkedType special classes
odersky 3fb11d2
Make implicit scope include companion objects of opaque types
odersky f9b141b
Add reference documentation
odersky 599b408
Fix test
odersky cdc5e54
Fix indentation
odersky 95a3d07
Treat companions of opaque types specially
odersky 1d03fc0
Replace annotation extractor with access methods
odersky 4293432
Simplify companion scheme
odersky 8ac08cc
add test
odersky c6bb46f
Bump minor Tasty version
odersky b2e85a0
Follow GADT bounds when computing members
odersky 7b67237
Consider GADT bounds for findMember and underlying
odersky 5de563b
Extend opaque companion context to inlined code
odersky f6dffe4
Add augment clauses
odersky 971e385
Allow for `type id` in type patterns
odersky 3e55b6b
Convert tests to use new type pattern syntax
odersky 6d2cbba
Base augment syntax on type patterns
odersky cb5ae51
Fix typo
odersky dc05718
Make annotation names compilation-order independent
odersky 958e67a
Require that non-extending augments only add extension methods
odersky f8b661d
Implement extension methods as implicit value classes
odersky b90acc1
Partially fix idempotency of static method order
nicolasstucki 55405d8
Allow labels naming an augment
odersky d4f50df
Use semantic names for augmentations
odersky 823ba95
Add regression test for idempotency issue on static methods
nicolasstucki 90ec0ee
Add docs for extension methods
odersky 0b0c2e0
More docs for augmentations
odersky 5297996
Remove duplicate test
odersky 1c55e04
Fix typos
odersky 1e4b2a1
Change syntax from augment/extends to extend/implements
odersky ff65a2b
Fix test and error reporting
odersky 53298ce
Require implemented types to be traits
odersky 19d12d9
Another test - magnet pattern
odersky f8bd21a
Change syntax of instance declarations
odersky b757ba9
A blue sky sketch how one could possibly evolve extends clauses
odersky 23c863e
Fix test
odersky 420a79d
Fix typos
odersky 09aa5d2
More blue sky variants
odersky 51bff8d
Some small updates and variants to blySkyExtensions
odersky cfc9058
Relax restriction about type overrides
odersky f65f8b3
More escaping of "extension"
odersky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Let's consider the impact on binary compatibility. Are there valid changes to the signature, which result in a new name, but which should not affect binary compatibility? Generally, I think it's important to give the programmer the ability to specify a name explicitly.
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.
One easy example: exchange a fully-qualified for a relative name or vice versa.
would be binary-incompatible with
under Martin's naming proposal.
Also, renaming a
type T
parameter intotype U
.Plenty more like that.
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.
Could use fully qualified names & a positional naming scheme for type params?
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.
I think that would not be what we want. We want variation, in particular in type parameter names, so that we can avoid double definitions.
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.
Sorry, I think what I meant to say was type patterns? The
type T
andtype U
that @sjrd mentioned above. I think you already have a double definition if you have an extension fortype T
andtype U
that share the same method name.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.
No that's precisely it - you want to enable multiple extends of the same type. So you should not get a double definition if you change the parameter type.