Commit 238a752
authored
Adjusted "Type Aliases" paragraph to outlaw explicit type arguments in
The old text in the section 'Type Aliases' in the language specification implies that it is possible to invoke a static method staticMethod of a class C via a type alias F with type arguments:
```dart
class C<X> {
void staticMethod() {}
}
typedef F<X> = C<X>;
void main() {
F<int>.staticMethod(); // Not an error previously, now an error.
}
```
With this commit, this is an error, which makes the spec consistent with the intentions and the language tests.
This PR also changes the grammar such that a type alias can denote a <type> rather than just a <functionType>, hence "enabling" non-function type aliases in general.F.staticMethod() (#1672)1 parent e5d6c97 commit 238a752
1 file changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
20117 | 20119 | | |
20118 | 20120 | | |
20119 | 20121 | | |
20120 | | - | |
20121 | 20122 | | |
20122 | 20123 | | |
20123 | | - | |
| 20124 | + | |
20124 | 20125 | | |
20125 | 20126 | | |
20126 | 20127 | | |
| |||
20333 | 20334 | | |
20334 | 20335 | | |
20335 | 20336 | | |
20336 | | - | |
20337 | | - | |
20338 | | - | |
20339 | | - | |
20340 | | - | |
20341 | | - | |
20342 | | - | |
20343 | | - | |
| 20337 | + | |
| 20338 | + | |
| 20339 | + | |
| 20340 | + | |
| 20341 | + | |
| 20342 | + | |
| 20343 | + | |
| 20344 | + | |
| 20345 | + | |
20344 | 20346 | | |
20345 | 20347 | | |
20346 | 20348 | | |
20347 | 20349 | | |
20348 | | - | |
| 20350 | + | |
20349 | 20351 | | |
20350 | 20352 | | |
20351 | 20353 | | |
20352 | | - | |
| 20354 | + | |
20353 | 20355 | | |
20354 | 20356 | | |
20355 | 20357 | | |
| |||
0 commit comments