Skip to content

Commit c312439

Browse files
authored
Update proposal-simple-lrhn.md
Tweak wording, avoid using "raw type".
1 parent 4ca7482 commit c312439

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

working/3616 - enum value shorthand/proposal-simple-lrhn.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Dart static access shorthand
22

3-
Author: [email protected]<br>Version: 1.4 (2025-01-08)
3+
Author: [email protected]<br>Version: 1.4.1 (2025-04-02)
44

55
You can write `.foo` instead of `ContextType.foo` when it makes sense. The rules
66
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
276276
recognized and made an error to avoid it being interpreted as `(C.new)<int>`.)_
277277

278278
**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.
281283
Doing `List<int> l = .filled(10, 10);` works like doing
282284
`List<int> l = List.filled(10, 10);`, and it is the following downwards
283285
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
709711

710712
## Versions
711713

714+
1.4.1 (2025-04-02): Fix phrasing to avoid using "raw type" where it means
715+
"uninstantiated type declaration reference".
716+
712717
1.4 (2025-01-08): Update constant rules.
713718

714719
* Doesn't require a constant `.new` tear-off to be a constant constructor.

0 commit comments

Comments
 (0)