Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b4210cc

Browse files
author
Dart CI
committed
Version 2.14.0-92.0.dev
Merge commit '454e633461138516ea052fe869a793c64cf2e490' into 'dev'
2 parents f606357 + 454e633 commit b4210cc

File tree

5 files changed

+65
-2
lines changed

5 files changed

+65
-2
lines changed

pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class ConvertToExpressionFunctionBody extends CorrectionProducer {
2828
if (body is! BlockFunctionBody || body.isGenerator) {
2929
return;
3030
}
31+
var parent = body.parent;
32+
if (parent is ConstructorDeclaration && parent.factoryKeyword == null) {
33+
return;
34+
}
3135
// prepare return statement
3236
List<Statement> statements = body.block.statements;
3337
if (statements.length != 1) {

pkg/analysis_server/test/src/services/correction/assist/convert_into_expression_body_test.dart

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ main() {
9090
''');
9191
}
9292

93-
Future<void> test_constructor() async {
93+
Future<void> test_constructor_factory() async {
9494
await resolveTestCode('''
9595
class A {
9696
A.named();
@@ -109,6 +109,19 @@ class A {
109109
''');
110110
}
111111

112+
Future<void> test_constructor_generative() async {
113+
await resolveTestCode('''
114+
class A {
115+
int x;
116+
117+
A() {
118+
x = 3;
119+
}
120+
}
121+
''');
122+
await assertNoAssistAt('A()');
123+
}
124+
112125
Future<void> test_function_onBlock() async {
113126
await resolveTestCode('''
114127
fff() {

tests/web/regress/45943_test.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2021, 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+
class _InspectorOverlayLayer {
6+
String selection;
7+
8+
_InspectorOverlayLayer(this.selection) {
9+
bool inDebugMode = false;
10+
assert(() {
11+
inDebugMode = true;
12+
return true;
13+
}());
14+
if (inDebugMode == false) {
15+
throw Error();
16+
}
17+
}
18+
}
19+
20+
main() {
21+
_InspectorOverlayLayer('hello');
22+
_InspectorOverlayLayer('hello');
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2021, 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+
class _InspectorOverlayLayer {
6+
String selection;
7+
8+
_InspectorOverlayLayer(this.selection) {
9+
bool inDebugMode = false;
10+
assert(() {
11+
inDebugMode = true;
12+
return true;
13+
}());
14+
if (inDebugMode == false) {
15+
throw Error();
16+
}
17+
}
18+
}
19+
20+
main() {
21+
_InspectorOverlayLayer('hello');
22+
_InspectorOverlayLayer('hello');
23+
}

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ CHANNEL dev
2727
MAJOR 2
2828
MINOR 14
2929
PATCH 0
30-
PRERELEASE 91
30+
PRERELEASE 92
3131
PRERELEASE_PATCH 0

0 commit comments

Comments
 (0)