Skip to content

Commit

Permalink
Version 3.2.0-79.0.dev
Browse files Browse the repository at this point in the history
Merge fd913bf into dev
  • Loading branch information
Dart CI committed Aug 16, 2023
2 parents d6e1fca + fd913bf commit 92c32df
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 41 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@

### Libraries

#### `dart:developer`

- Deprecated the `Service.getIsolateID` method.
- Added `getIsolateId` method to `Service`.
- Added `getObjectId` method to `Service`.

#### `dart:io`

- **Breaking change** [#53005][]: The headers returned by
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ vars = {

# co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
# hashes.
"co19_rev": "bbb3feb38db0a9c4489736229ea9b06215a1706b",
"co19_rev": "c7f412ab8b0ad444eea4d6dbd7616b475e050fab",
# This line prevents conflicts when both packages are rolled simultaneously.
"co19_2_rev": "3756b19f79b85b7640a6805dd2c819792a13041c",

Expand Down
12 changes: 7 additions & 5 deletions pkg/analyzer/lib/src/generated/error_detection_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ mixin ErrorDetectionHelpers {
expression,
[staticType, fieldType],
messages);
} else {
errorReporter.reportErrorForNode(
CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE,
expression,
[staticType, fieldType],
messages);
}
errorReporter.reportErrorForNode(
CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE,
expression,
[staticType, fieldType],
messages);

// TODO(brianwilkerson) Define a hint corresponding to these errors and
// report it if appropriate.
// // test the propagated type of the expression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'package:analyzer/src/error/codes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';

import '../../generated/test_support.dart';
import '../dart/resolution/context_collection_resolution.dart';

main() {
Expand All @@ -24,14 +25,35 @@ class A {
''');
}

test_enum_unrelated() async {
await assertErrorsInCode('''
enum E {
v;
final int x;
const E() : x = '';
}
''', [
error(
CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
11,
1,
contextMessages: [
ExpectedContextMessage(testFile.path, 47, 2,
text:
"The exception is 'In a const constructor, a value of type 'String' can't be assigned to the field 'x', which has type 'int'.' and occurs here."),
],
),
error(CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, 47, 2),
]);
}

test_notAssignable_unrelated() async {
await assertErrorsInCode(r'''
class A {
final int x;
const A() : x = '';
}
''', [
error(CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, 43, 2),
error(CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, 43, 2),
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import 'package:analyzer/src/error/codes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';

import '../../generated/test_support.dart';
import '../dart/resolution/context_collection_resolution.dart';

main() {
Expand Down Expand Up @@ -53,29 +52,6 @@ class A {
error(CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, 31, 2),
]);
}

test_enum_unrelated() async {
await assertErrorsInCode('''
enum E {
v;
final int x;
const E() : x = '';
}
''', [
error(
CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
11,
1,
contextMessages: [
ExpectedContextMessage(testFile.path, 47, 2,
text:
"The exception is 'In a const constructor, a value of type 'String' can't be assigned to the field 'x', which has type 'int'.' and occurs here."),
],
),
error(CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, 47, 2),
error(CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, 47, 2),
]);
}
}

@reflectiveTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ Future testeeMain() async {
childIsolate = await iso.Isolate.spawn(spawnEntry, 0);
// Assign the id for this isolate and it's child to strings so they can
// be read by the tester.
// ignore: sdk_version_since
selfId = Service.getIsolateId(iso.Isolate.current)!;
// ignore: sdk_version_since
childId = Service.getIsolateId(childIsolate)!;
debugger();
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/lib/developer/developer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
/// {@category Core}
library dart.developer;

import 'dart:_internal' show checkNotNullable;
import 'dart:_internal' show checkNotNullable, Since;
import 'dart:async';
import 'dart:collection';
import 'dart:convert';
Expand Down
1 change: 1 addition & 0 deletions sdk/lib/developer/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ final class Service {
///
/// Returns null if the running Dart environment does not support the service
/// protocol.
@Since('3.2')
static String? getIsolateId(Isolate isolate) {
// TODO: When NNBD is complete, delete the following line.
ArgumentError.checkNotNull(isolate, 'isolate');
Expand Down
2 changes: 0 additions & 2 deletions tests/language/compile_time_constant/static2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class A {
const A.a1() : x = 'foo';
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
const A.a2(this.x);
const A.a3([this.x = 'foo']);
Expand All @@ -22,7 +21,6 @@ class A {
const A.a5(String x) : this.x = x;
// ^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
const A.a6(int x) : this.x = x;
}
Expand Down
2 changes: 0 additions & 2 deletions tests/language/compile_time_constant/static3_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class A {
const A.a1() : x = 'foo';
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
const A.a2(this.x);
const A.a3([this.x = 'foo']);
Expand All @@ -22,7 +21,6 @@ class A {
const A.a5(String x) : this.x = x;
// ^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
const A.a6(int x) : this.x = x;
}
Expand Down
2 changes: 0 additions & 2 deletions tests/language_2/compile_time_constant/static2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class A {
const A.a1() : x = 'foo';
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
const A.a2(this.x);
const A.a3([this.x = 'foo']);
Expand All @@ -24,7 +23,6 @@ class A {
const A.a5(String x) : this.x = x;
// ^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
const A.a6(int x) : this.x = x;
}
Expand Down
2 changes: 0 additions & 2 deletions tests/language_2/compile_time_constant/static3_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class A {
const A.a1() : x = 'foo';
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
const A.a2(this.x);
const A.a3([this.x = 'foo']);
Expand All @@ -24,7 +23,6 @@ class A {
const A.a5(String x) : this.x = x;
// ^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
const A.a6(int x) : this.x = x;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 2
PATCH 0
PRERELEASE 78
PRERELEASE 79
PRERELEASE_PATCH 0

0 comments on commit 92c32df

Please sign in to comment.