-
Notifications
You must be signed in to change notification settings - Fork 230
Added first draft of implementation-plan.md for generalized type aliases #118
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
Changes from all commits
Commits
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
75 changes: 75 additions & 0 deletions
75
accepted/future-releases/generalized-typedef-2018/implementation-plan.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Implementation Plan for the Q1 2019 Generalized Type Alias Feature | ||
|
|
||
| Relevant documents: | ||
| - [Tracking issue](https://github.com/dart-lang/language/issues/115) | ||
| - [Feature specification](https://github.com/dart-lang/language/blob/master/accepted/future-releases/generalized-typedef-2018/feature-specification.md) | ||
|
|
||
| ## Implementation and Release plan | ||
|
|
||
| This feature is non-breaking, because it is concerned with the introduction of | ||
| support for new syntactic forms. | ||
| Still, we will introduce it using an | ||
| [experiments flag](https://github.com/dart-lang/sdk/blob/master/docs/process/experimental-flags.md) | ||
| in order to enable a controlled deployment. | ||
|
|
||
|
|
||
| ### Phase 0 (Preliminaries) | ||
|
|
||
| #### Release Flag | ||
|
|
||
| The flag | ||
| `--enable-experiment=nonfunction-type-aliases` | ||
| must be passed for the changes to be enabled. | ||
| In this phase, support for that flag is added to all tools. | ||
|
|
||
| #### Tests | ||
|
|
||
| The language team adds a set of tests for the new feature, in terms of | ||
| declarations and usages in the following situations: | ||
|
|
||
| - A type alias with and without type arguments is used | ||
| - as a type annotation for a variable of various kinds. | ||
| - as a type argument of a class or another type alias. | ||
| - as part of a function type. | ||
| - in a function declaration as return type or parameter type. | ||
| - as an expression. | ||
| - as the type in an `on` clause. | ||
| - in a type test (`is`). | ||
| - in a type cast (`as`). | ||
| - A type alias whose body is a class with or without type arguments, is used in | ||
| - the `extends` clause of a class. | ||
| - the `with` clause of a class. | ||
| - the `implements` clause of a class or mixin. | ||
| - the `on` clause of a mixin. | ||
| - instance creation expressions, constant and non-constant. | ||
| - an invocation of a static method, getter, setter, and a tear-off of a | ||
| static method; note that the provision of type arguments | ||
| (`F<int>.m()`) is an error here. | ||
|
|
||
| The co19 team start creating tests early, such that those tests can be | ||
| used during implementation as well. | ||
|
|
||
| ### Phase 1 (Implementation) | ||
|
|
||
| All tools implement syntactic support for type aliases of the form | ||
|
|
||
| ```dart | ||
| typedef F<TypeArguments> = type; | ||
| ``` | ||
|
|
||
| where `type` can be any type, rather than just a function type. | ||
|
|
||
| All tools implement support for using such type aliases, in all situations | ||
| mentioned under phase 0. | ||
|
|
||
| ### Phase 2 (Release) | ||
|
|
||
| The feature is released as part of the next stable Dart release. | ||
|
|
||
| ## Timeline | ||
|
|
||
| Completion goals for the phases: | ||
|
|
||
| - Phase 0: (TODO) | ||
| - Phase 1: (TODO) | ||
| - Phase 2: (TODO) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.