|
1 | 1 | # Dart static access shorthand
|
2 | 2 |
|
3 |
| -Author: [email protected]< br>Version: 1.4 (2025- 01-08) |
| 3 | +Author: [email protected]< br>Version: 1.4 .1 (2025- 04-02) |
4 | 4 |
|
5 | 5 | You can write `.foo` instead of `ContextType.foo` when it makes sense. The rules
|
6 | 6 | are fairly simple and easy to explain.
|
@@ -276,8 +276,10 @@ a `C.new`, or a `C.id` denoting a constructor, followed by type arguments is
|
276 | 276 | recognized and made an error to avoid it being interpreted as `(C.new)<int>`.)_
|
277 | 277 |
|
278 | 278 | **Notice**: The invocation of a constructor is *not* using an instantiated type,
|
279 |
| -it’s behaving as if the constructor was preceded by a *raw type*, which type |
280 |
| -inference should then infer type arguments for. |
| 279 | +it’s behaving as if the constructor was preceded by an uninstantiated reference |
| 280 | +to the declaration, which type inference should then infer type arguments for |
| 281 | +based on the actual context type of the constructor invocation expression, |
| 282 | +which is not necessarily the shorthand context. |
281 | 283 | Doing `List<int> l = .filled(10, 10);` works like doing
|
282 | 284 | `List<int> l = List.filled(10, 10);`, and it is the following downwards
|
283 | 285 | inference with context type `List<int>` that makes it into
|
@@ -709,6 +711,9 @@ not members of `Future`. Primarily to allow people to return values from
|
709 | 711 |
|
710 | 712 | ## Versions
|
711 | 713 |
|
| 714 | +1.4.1 (2025-04-02): Fix phrasing to avoid using "raw type" where it means |
| 715 | + "uninstantiated type declaration reference". |
| 716 | + |
712 | 717 | 1.4 (2025-01-08): Update constant rules.
|
713 | 718 |
|
714 | 719 | * Doesn't require a constant `.new` tear-off to be a constant constructor.
|
|
0 commit comments