Skip to content

Commit ef771d4

Browse files
kallentuCommit Queue
authored andcommitted
[tests] Enum shorthands - Import prefixes.
Testing that enum shorthands work even with import prefixes of declarations. Bug: #57038 Change-Id: I8026f062a2b405d4f92efff7abad1a03fa229eda Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402425 Commit-Queue: Kallen Tu <[email protected]> Reviewed-by: Erik Ernst <[email protected]>
1 parent 0577ca0 commit ef771d4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// Contexts with a prefix import should still work with enum shorthands.
6+
7+
// SharedOptions=--enable-experiment=enum-shorthands
8+
9+
import '../enum_shorthand_helper.dart' as prefix;
10+
11+
void main() {
12+
prefix.Integer integer = .one;
13+
const prefix.Integer constInteger = .constOne;
14+
15+
// Nested
16+
prefix.ConstructorClass ctorMemberCtor = .staticMember(.ctor(.named(x: 1)));
17+
18+
// Selector chain
19+
prefix.StaticMember memberMixed2 = .member().field.method();
20+
}

0 commit comments

Comments
 (0)