-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge ba9f351 into dev
- Loading branch information
Showing
11 changed files
with
362 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
tests/language/enum_shorthands/constructor/constructor_collection_literal_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
// Context type is propagated down in collection literals. | ||
// Testing with constructor shorthands. | ||
|
||
// SharedOptions=--enable-experiment=enum-shorthands | ||
|
||
import '../enum_shorthand_helper.dart'; | ||
|
||
void main() { | ||
var ctorList = <ConstructorClass>[ | ||
.new(1), | ||
.regular(1), | ||
.named(x: 1), | ||
.optional(1), | ||
]; | ||
var ctorSet = <ConstructorClass>{ | ||
.new(1), | ||
.regular(1), | ||
.named(x: 1), | ||
.optional(1), | ||
}; | ||
var ctorMap = <ConstructorClass, ConstructorClass>{ | ||
.new(1): .new(1), | ||
.regular(1): .regular(1), | ||
.named(x: 1): .named(x: 1), | ||
.optional(1): .optional(1), | ||
}; | ||
var ctorMap2 = <ConstructorClass, (ConstructorClass, ConstructorClass)>{ | ||
.new(1): (.new(1), .new(1)), | ||
.regular(1): (.regular(1), .regular(1)), | ||
.named(x: 1): (.named(x: 1), .named(x: 1)), | ||
.optional(1): (.optional(1), .optional(1)), | ||
}; | ||
|
||
var ctorExtList = <ConstructorExt>[ | ||
.new(1), | ||
.regular(1), | ||
.named(x: 1), | ||
.optional(1), | ||
]; | ||
var ctorExtSet = <ConstructorExt>{ | ||
.new(1), | ||
.regular(1), | ||
.named(x: 1), | ||
.optional(1), | ||
}; | ||
var ctorExtMap = <ConstructorExt, ConstructorExt>{ | ||
.new(1): .new(1), | ||
.regular(1): .regular(1), | ||
.named(x: 1): .named(x: 1), | ||
.optional(1): .optional(1), | ||
}; | ||
var ctorExtMap2 = <ConstructorExt, (ConstructorExt, ConstructorExt)>{ | ||
.new(1): (.new(1), .new(1)), | ||
.regular(1): (.regular(1), .regular(1)), | ||
.named(x: 1): (.named(x: 1), .named(x: 1)), | ||
.optional(1): (.optional(1), .optional(1)), | ||
}; | ||
} |
38 changes: 38 additions & 0 deletions
38
tests/language/enum_shorthands/member/static_method_collection_literal_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
// Context type is propagated down in collection literals. | ||
// Testing with static method shorthands. | ||
|
||
// SharedOptions=--enable-experiment=enum-shorthands | ||
|
||
import '../enum_shorthand_helper.dart'; | ||
|
||
void main() { | ||
var memberList = <StaticMember>[.member(), .memberType<String, int>('s'), .member()]; | ||
var memberSet = <StaticMember>{.member(), .memberType<String, int>('s')}; | ||
var memberMap = <StaticMember, StaticMember>{ | ||
.member(): .memberType<String, int>('s'), | ||
.memberType<String, int>('s'): .memberType<String, int>('s'), | ||
}; | ||
var memberMap2 = <StaticMember, (StaticMember, StaticMember)>{ | ||
.member(): (.member(), .memberType<String, int>('s')), | ||
.memberType<String, int>('s'): (.memberType<String, int>('s'), .memberType<String, int>('s')), | ||
}; | ||
|
||
var memberExtList = <StaticMemberExt>[ | ||
.member(), | ||
.memberType<String, int>('s'), | ||
.member(), | ||
]; | ||
var memberExtSet = <StaticMemberExt>{.member(), .memberType<String, int>('s')}; | ||
var memberExtMap = <StaticMemberExt, StaticMemberExt>{ | ||
.member(): .memberType<String, int>('s'), | ||
.memberType<String, int>('s'): .memberType<String, int>('s'), | ||
}; | ||
var memberExtMap2 = <StaticMemberExt, (StaticMemberExt, StaticMemberExt)>{ | ||
.member(): (.member(), .memberType<String, int>('s')), | ||
.memberType<String, int>('s'): (.memberType<String, int>('s'), .memberType<String, int>('s')), | ||
}; | ||
} |
Oops, something went wrong.