-
Notifications
You must be signed in to change notification settings - Fork 229
Batched small updates #1003
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
Batched small updates #1003
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,11 @@ Status: Draft | |
|
|
||
| ## CHANGELOG | ||
|
|
||
| 2020..06.02 | ||
| - Fix the diff to the spec for potentially constant instance checks | ||
| - Specify that extensions do not apply to values of type `Never` | ||
| - Specify the treatment of typedefs from legacy libraries | ||
|
|
||
| 2020.05.20 | ||
| - Turn new references to `CastError` into being dynamic type errors. | ||
|
|
||
|
|
@@ -702,9 +707,13 @@ class G<T> { | |
|
|
||
| For the purposes of extension method resolution, there is no special treatment | ||
| of nullable types with respect to what members are considered accessible. That | ||
| is, the only members of a nullable tyhpe that are considered accessible | ||
| is, the only members of a nullable type that are considered accessible | ||
| (and hence which take precedence over extensions) are the members on `Object`. | ||
|
|
||
| For the purposes of extension method resolution, the type `Never` is considered | ||
| to implement all members, and hence no extension may apply to an expression of | ||
| type `Never`. | ||
|
|
||
| ### Assignability | ||
|
|
||
| The definition of assignability is changed as follows. | ||
|
|
@@ -756,7 +765,8 @@ We change the following specification text: | |
| to | ||
|
|
||
| ``` | ||
| \item An expression of the form \code{$e$\,\,as\,\,$T$} is potentially constant | ||
| \item An expression of the form \code{$e$\,\,as\,\,$T$} or | ||
| \code{$e$\,\,is\,\,$T$} is potentially constant | ||
| if $e$ is a potentially constant expression | ||
| and $T$ is a potentially constant type expression, | ||
| and it is further constant if $e$ is constant. | ||
|
|
@@ -1215,6 +1225,31 @@ all occurrences of `S*` in `T` shall be replaced with `S`. As a result, legacy | |
| types will never appear as type annotations in opted-in libraries, nor will they | ||
| appear in reified positions. | ||
|
|
||
| ### Typedefs defined in legacy libraries used in opted-in libraries | ||
|
|
||
| A typedef which is define in a legacy library and used in an opted-in library is | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. defined |
||
| treated as defining a function type, all of the components of which are | ||
| legacy. The function type itself is treated as non-nullable (and not legacy) at | ||
| the top level. Hence given the following program, it is an error to assign a | ||
| nullable value to a variable of type `F` in an opted-in library, but any | ||
| function which is compatible with a legacy function of type `int* | ||
| Function(int*)` may be assigned to such a variable. | ||
|
|
||
| ```dart | ||
| // Opted-out library "opted_out.dart". | ||
| typedef F = int Function(int); | ||
|
|
||
| // Opted-in library "main.dart" | ||
| import "opted_out.dart"; | ||
|
|
||
| int? f1(int x) => x; | ||
|
|
||
| void test() { | ||
| F f = null; // Static error | ||
| f = f1; // No error | ||
| } | ||
| ``` | ||
|
|
||
| ### Exports | ||
|
|
||
| If a legacy library re-exports an opted-in library, the re-exported symbols | ||
|
|
||
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
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.