Version 2.17.3
* Cherry-pick refs/changes/82/246582/1 to stable
* Cherry-pick refs/changes/41/246041/1 to stable
* Cherry-pick refs/changes/43/246643/2 to stable
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 880028a..b1291f6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,12 +1,16 @@
-## 2.17.2 - 2022-06-01
+## 2.17.3 - 2022-06-01
This is a patch release that fixes:
- a Dart VM compiler crash (issue [#100375][]).
-- code completion when writing method overrides (issue [#49086][]).
+- code completion when writing method overrides (issue [#49027][]).
+- the `dart pub login` command (issue [#3424][]).
+- analysis of enhanced enums (issue [#49097][]).
[#100375]: https://github.com/flutter/flutter/issues/100375
-[#49086]: https://github.com/dart-lang/sdk/issues/49086
+[#49027]: https://github.com/dart-lang/sdk/issues/49027
+[#3424]: https://github.com/dart-lang/pub/issues/3424
+[#49097]: https://github.com/dart-lang/sdk/issues/49097
## 2.17.1 - 2022-05-18
diff --git a/DEPS b/DEPS
index 5471a60..257d408 100644
--- a/DEPS
+++ b/DEPS
@@ -141,7 +141,7 @@
"pool_rev": "7abe634002a1ba8a0928eded086062f1307ccfae",
"process_rev": "56ece43b53b64c63ae51ec184b76bd5360c28d0b",
"protobuf_rev": "c1eb6cb51af39ccbaa1a8e19349546586a5c8e31",
- "pub_rev": "a949b329b1b51f5f3973a790e0a0a45897d837de",
+ "pub_rev": "c66381c51147e3a8fb64c6f63e481c990ab9aa94",
"pub_semver_rev": "ea6c54019948dc03042c595ce9413e17aaf7aa38",
"root_certificates_rev": "692f6d6488af68e0121317a9c2c9eb393eb0ee50",
"rust_revision": "b7856f695d65a8ebc846754f97d15814bcb1c244",
diff --git a/pkg/analyzer/lib/src/summary2/default_value_resolver.dart b/pkg/analyzer/lib/src/summary2/default_value_resolver.dart
index 632a6c4..8170e42 100644
--- a/pkg/analyzer/lib/src/summary2/default_value_resolver.dart
+++ b/pkg/analyzer/lib/src/summary2/default_value_resolver.dart
@@ -23,6 +23,7 @@
for (var unitElement in _libraryElement.units.impl) {
_UnitContext(unitElement)
..forEach(unitElement.classes, _class)
+ ..forEach(unitElement.enums, _class)
..forEach(unitElement.extensions, _extension)
..forEach(unitElement.functions, _executable)
..forEach(unitElement.mixins, _class);
diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart
index 66cd709..957f0b8 100644
--- a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart
@@ -98,6 +98,25 @@
]);
}
+ test_enum_issue49097() async {
+ newFile2('$testPackageLibPath/a.dart', r'''
+class A {
+ static const foo = A();
+ static const bar = A();
+ const A();
+}
+''');
+ await assertNoErrorsInCode(r'''
+import 'a.dart';
+
+enum E {
+ v(f: A.foo);
+ final A f;
+ const E({this.f = A.bar});
+}
+''');
+ }
+
test_function_named() async {
await assertErrorsInCode(r'''
int y = 0;
diff --git a/pkg/analyzer/test/src/summary/elements_test.dart b/pkg/analyzer/test/src/summary/elements_test.dart
index fdca05f..4894374 100644
--- a/pkg/analyzer/test/src/summary/elements_test.dart
+++ b/pkg/analyzer/test/src/summary/elements_test.dart
@@ -17847,6 +17847,79 @@
''');
}
+ test_enum_constructor_fieldFormal_optionalNamed_defaultValue() async {
+ var library = await buildLibrary(r'''
+enum E {
+ v;
+ final int x;
+ const E({this.x = 1 + 2});
+}
+''');
+ checkElementText(library, r'''
+library
+ definingUnit
+ enums
+ enum E @5
+ supertype: Enum
+ fields
+ static const enumConstant v @11
+ type: E
+ constantInitializer
+ InstanceCreationExpression
+ constructorName: ConstructorName
+ type: NamedType
+ name: SimpleIdentifier
+ token: E @-1
+ staticElement: self::@enum::E
+ staticType: null
+ type: E
+ staticElement: self::@enum::E::@constructor::•
+ argumentList: ArgumentList
+ leftParenthesis: ( @0
+ rightParenthesis: ) @0
+ staticType: E
+ synthetic static const values @-1
+ type: List<E>
+ constantInitializer
+ ListLiteral
+ leftBracket: [ @0
+ elements
+ SimpleIdentifier
+ token: v @-1
+ staticElement: self::@enum::E::@getter::v
+ staticType: E
+ rightBracket: ] @0
+ staticType: List<E>
+ final x @26
+ type: int
+ constructors
+ const @37
+ parameters
+ optionalNamed final this.x @45
+ type: int
+ constantInitializer
+ BinaryExpression
+ leftOperand: IntegerLiteral
+ literal: 1 @49
+ staticType: int
+ operator: + @51
+ rightOperand: IntegerLiteral
+ literal: 2 @53
+ staticType: int
+ staticElement: dart:core::@class::num::@method::+
+ staticInvokeType: num Function(num)
+ staticType: int
+ field: self::@enum::E::@field::x
+ accessors
+ synthetic static get v @-1
+ returnType: E
+ synthetic static get values @-1
+ returnType: List<E>
+ synthetic get x @-1
+ returnType: int
+''');
+ }
+
test_enum_constructor_fieldFormal_typed_typed() async {
var library = await buildLibrary('''
enum E {
diff --git a/tools/VERSION b/tools/VERSION
index 419566c..a2075a5 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -26,6 +26,6 @@
CHANNEL stable
MAJOR 2
MINOR 17
-PATCH 2
+PATCH 3
PRERELEASE 0
PRERELEASE_PATCH 0
\ No newline at end of file