Skip to content

Commit 6f16577

Browse files
committed
comment out excerpt, add version note
1 parent 310478c commit 6f16577

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

examples/misc/lib/language_tour/built_in_types.dart

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// ignore_for_file: dead_code, unused_local_variable, type_annotate_public_apis
22
// ignore_for_file: prefer_single_quotes, prefer_collection_literals
3-
// ignore_for_file: experiment_not_enabled
43

54
void miscDeclAnalyzedButNotTested() {
65
{
@@ -38,15 +37,16 @@ void miscDeclAnalyzedButNotTested() {
3837
// #enddocregion const-num
3938
}
4039

41-
{
42-
// #docregion digit-separators
43-
var n1 = 1_000_000;
44-
var n2 = 0.000_000_000_01;
45-
var n3 = 0x00_14_22_01_23_45; // MAC address
46-
var n4 = 555_123_4567; // US Phone number
47-
var n5 = 100__000_000__000_000; // one hundred million million!
48-
// #enddocregion digit-separators
49-
}
40+
// Uncomment when feature is stable:
41+
// {
42+
// // #docregion digit-separators
43+
// var n1 = 1_000_000;
44+
// var n2 = 0.000_000_000_01;
45+
// var n3 = 0x00_14_22_01_23_45; // MAC address
46+
// var n4 = 555_123_4567; // US Phone number
47+
// var n5 = 100__000_000__000_000; // one hundred million million!
48+
// // #enddocregion digit-separators
49+
// }
5050

5151
{
5252
// #docregion quoting

src/content/language/built-in-types.md

+9
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ You can use one or more underscores (`_`) as digit separators
177177
to make long number literals more readable.
178178
Multiple digit separators allow for higher level grouping.
179179

180+
{% comment %}
181+
Uncomment when feature is stable:
182+
180183
<?code-excerpt "misc/lib/language_tour/built_in_types.dart (digit-separators)"?>
184+
{% endcomment %}
181185
```dart
182186
var n1 = 1_000_000;
183187
var n2 = 0.000_000_000_01;
@@ -186,6 +190,10 @@ var n4 = 555_123_4567; // US Phone number
186190
var n5 = 100__000_000__000_000; // one hundred million million!
187191
```
188192

193+
:::version-note
194+
Using digit separators requires a [language version][] of at least 3.6.0.
195+
:::
196+
189197
## Strings
190198

191199
A Dart string (`String` object) holds a sequence of UTF-16 code units.
@@ -427,3 +435,4 @@ Symbol literals are compile-time constants.
427435
[characters API]: {{site.pub-api}}/characters
428436
[characters example]: {{site.pub-pkg}}/characters/example
429437
[`Symbol`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-core/Symbol-class.html
438+
[language version]: /guides/language/evolution#language-versioning

0 commit comments

Comments
 (0)