From 66c6aadd1d3eb1a83f664dca2b58bc6316c6b4a0 Mon Sep 17 00:00:00 2001 From: "Sergey G. Grekhov" Date: Tue, 3 Dec 2024 00:58:16 +0200 Subject: [PATCH] Update example in Static access shorthand proposal (#4191) --- .../3616 - enum value shorthand/proposal-simple-lrhn.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/working/3616 - enum value shorthand/proposal-simple-lrhn.md b/working/3616 - enum value shorthand/proposal-simple-lrhn.md index 5b28cc64e..9074a1d4b 100644 --- a/working/3616 - enum value shorthand/proposal-simple-lrhn.md +++ b/working/3616 - enum value shorthand/proposal-simple-lrhn.md @@ -57,7 +57,10 @@ That means you can write things like the following (with the intended meaning as comments, specification to achieve that below): ```dart -Endian littleEndian = .little; // -> Endian.little (enum value) +// -> HttpClientResponseCompressionState.compressed (enum value) +HttpClientResponseCompressionState state = .compressed; + +Endian littleEndian = .little; // -> Endian.little (static constant) Endian hostEndian = .host; // -> Endian.host (getter) // -> Endian.little, Endian.big, Endian.host Endian endian = firstWord == 0xFEFF ? .little : firstWord = 0xFFFE ? .big : .host; @@ -270,7 +273,7 @@ and *T*.new\<*typeArgs*\> already are, whether used as instantiated tear-off or invoked. _(The grammar allows them, because `C.new` is a `` expression, but a `C.new`, or a `C.id` denoting a constructor, followed by type arguments is -recognized and made an error to avoid it being interpreted as `(C.new)`.) +recognized and made an error to avoid it being interpreted as `(C.new)`.)_ **Notice**: The invocation of a constructor is *not* using an instantiated type, it’s behaving as if the constructor was preceded by a *raw type*, which type