Skip to content

Commit

Permalink
Version 2.17.3
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
whesse committed Jun 1, 2022
2 parents 677df74 + e4481b7 commit 18df0aa
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 5 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ vars = {
"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",
Expand Down
1 change: 1 addition & 0 deletions pkg/analyzer/lib/src/summary2/default_value_resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class DefaultValueResolver {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,25 @@ class A {
]);
}

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;
Expand Down
73 changes: 73 additions & 0 deletions pkg/analyzer/test/src/summary/elements_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17847,6 +17847,79 @@ library
''');
}

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 {
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
CHANNEL stable
MAJOR 2
MINOR 17
PATCH 2
PATCH 3
PRERELEASE 0
PRERELEASE_PATCH 0

0 comments on commit 18df0aa

Please sign in to comment.