Skip to content

Commit

Permalink
Version 2.3.1
Browse files Browse the repository at this point in the history
* Cherry-pick 9ac7bd7 to stable
  • Loading branch information
athomas committed May 21, 2019
2 parents 29c7116 + 07320b3 commit 3f2d646
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 2.3.1 - 2019-05-21

This is a patch version release with bug fixes.

### Tools

#### dart2js

* Fixed a bug that caused the compiler to crash when it compiled UI-as-code
features within fields (Issue [36864][]).

[36864]: https://github.com/dart-lang/sdk/issues/36864

## 2.3.0 - 2019-05-08

The focus in this release is on the new "UI-as-code" language features which
Expand Down
3 changes: 3 additions & 0 deletions pkg/compiler/lib/src/ir/static_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,11 @@ abstract class StaticTypeVisitor extends StaticTypeBase {
@override
Null visitField(ir.Field node) {
thisType = new ThisInterfaceType.from(node.enclosingClass?.thisType);
_currentVariables = new Set<ir.VariableDeclaration>();
visitNode(node.initializer);
handleField(node);
_invalidatedVariables.removeAll(_currentVariables);
_currentVariables = null;
thisType = null;
}

Expand Down
27 changes: 27 additions & 0 deletions tests/compiler/dart2js_extra/block_expression_on_field_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) 2019, 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.

/// Regression test for #36864
///
/// Block expressions in top-level fields used to crash the compiler.
import "package:expect/expect.dart";

final _a = {
...{1}
};

class B {
static Set _b = {
...{2}
};
Set _c = {
...{3}
};
}

main() {
Expect.setEquals({1}, _a);
Expect.setEquals({2}, B._b);
Expect.setEquals({3}, (new B()._c));
}
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
CHANNEL stable
MAJOR 2
MINOR 3
PATCH 0
PATCH 1
PRERELEASE 0
PRERELEASE_PATCH 0
ABI_VERSION 4
Expand Down

0 comments on commit 3f2d646

Please sign in to comment.