Skip to content

Commit 1f83e54

Browse files
author
Dart CI
committed
Version 2.12.0-142.0.dev
Merge commit '690ae7a7ba4f8038dcf58721411beb673c860438' into 'dev'
2 parents e4c9b06 + 690ae7a commit 1f83e54

38 files changed

+437
-108
lines changed

BUILD.gn

Lines changed: 81 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,64 @@ if (is_fuchsia) {
159159
import("third_party/fuchsia/sdk/linux/build/component.gni")
160160
import("third_party/fuchsia/sdk/linux/build/package.gni")
161161

162-
fuchsia_component("fuchsia_test_component") {
163-
testonly = true
164-
data_deps = [ "runtime/bin:dart" ]
165-
manifest = "build/fuchsia/dart.cmx"
162+
template("dart_fuchsia_test_package") {
163+
fuchsia_package(target_name) {
164+
package_name = invoker.package_name
165+
if (is_debug) {
166+
package_name += "_debug"
167+
} else if (is_release) {
168+
package_name += "_release"
169+
} else if (is_product) {
170+
package_name += "_product"
171+
}
172+
testonly = true
173+
deps = invoker.deps
174+
}
175+
}
166176

167-
resource_files = [
168-
".dart_tool/package_config.json",
169-
"pkg/testing/test/hello_test.dart",
170-
"tools/addlatexhash.dart",
171-
]
177+
template("dart_fuchsia_test_component") {
178+
fuchsia_component(target_name) {
179+
testonly = true
180+
data_deps = [ "runtime/bin:dart" ]
181+
if (defined(invoker.data_deps)) {
182+
data_deps += invoker.data_deps
183+
}
184+
manifest = "build/fuchsia/dart.cmx"
185+
186+
library_files = []
187+
if (defined(invoker.library_files)) {
188+
library_files += invoker.library_files
189+
}
190+
resource_files = [
191+
".dart_tool/package_config.json",
192+
"pkg/testing/test/hello_test.dart",
193+
"tools/addlatexhash.dart",
194+
]
195+
resource_dirs = invoker.resource_dirs
196+
197+
resources = []
198+
foreach(file, library_files) {
199+
resources += [
200+
{
201+
path = root_out_dir + "/" + file
202+
dest = "lib/" + file
203+
},
204+
]
205+
}
206+
foreach(file, resource_files) {
207+
resources += [
208+
{
209+
path = file
210+
dest = "data/" + file
211+
},
212+
]
213+
}
214+
resources +=
215+
exec_script("tools/fuchsia/find_resources.py", resource_dirs, "json")
216+
}
217+
}
218+
219+
dart_fuchsia_test_component("fuchsia_test_component") {
172220
resource_dirs = [
173221
"tests/standalone_2",
174222
"pkg/async_helper",
@@ -190,30 +238,32 @@ if (is_fuchsia) {
190238
"third_party/pkg/string_scanner",
191239
"third_party/pkg/typed_data",
192240
]
193-
194-
resources = []
195-
foreach(file, resource_files) {
196-
resources += [
197-
{
198-
path = file
199-
dest = "data/" + file
200-
},
201-
]
202-
}
203-
resources +=
204-
exec_script("tools/fuchsia/find_resources.py", resource_dirs, "json")
205241
}
206242

207-
fuchsia_package("fuchsia_test_package") {
208-
package_name = "dart_test_"
209-
if (is_debug) {
210-
package_name += "debug"
211-
} else if (is_release) {
212-
package_name += "release"
213-
} else if (is_product) {
214-
package_name += "product"
215-
}
216-
testonly = true
243+
dart_fuchsia_test_package("fuchsia_test_package") {
244+
package_name = "dart_test"
217245
deps = [ ":fuchsia_test_component" ]
218246
}
247+
248+
dart_fuchsia_test_component("fuchsia_ffi_test_component") {
249+
data_deps = [
250+
"runtime/bin:ffi_test_dynamic_library",
251+
"runtime/bin:ffi_test_functions",
252+
]
253+
library_files = [
254+
"libffi_test_dynamic_library.so",
255+
"libffi_test_functions.so",
256+
]
257+
resource_dirs = [
258+
"pkg/expect",
259+
"pkg/meta",
260+
"tests/ffi",
261+
"third_party/pkg/ffi",
262+
]
263+
}
264+
265+
dart_fuchsia_test_package("fuchsia_ffi_test_package") {
266+
package_name = "dart_ffi_test"
267+
deps = [ ":fuchsia_ffi_test_component" ]
268+
}
219269
}

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ deps = {
565565
"packages": [
566566
{
567567
"package": "fuchsia/sdk/gn/linux-amd64",
568-
"version": "git_revision:8d5242d4f6ff8b7634b492700e60b0fd09abefa3"
568+
"version": "git_revision:e0a61431eb6e28d31d293cbb0c12f6b3a089bba4"
569569
}
570570
],
571571
"condition": 'host_os == "linux" and host_cpu == "x64"',

build/toolchain/fuchsia/BUILD.gn

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ if (use_goma) {
1717
}
1818

1919
toolchain("fuchsia") {
20-
assert(target_cpu == "x64", "We currently only support 'x64' for fuchsia.")
20+
assert(target_cpu == "x64" || target_cpu == "arm64",
21+
"We currently only support 'x64' and 'arm64' for fuchsia.")
2122
toolchain_bin =
22-
rebase_path("//buildtools/$host_os-$target_cpu/clang/bin", root_out_dir)
23+
rebase_path("//buildtools/$host_os-x64/clang/bin", root_out_dir)
2324
fuchsia_sdk = rebase_path("//third_party/fuchsia/sdk/$host_os", root_out_dir)
2425

2526
# We can't do string interpolation ($ in strings) on things with dots in
@@ -34,6 +35,10 @@ toolchain("fuchsia") {
3435
strip = "${toolchain_bin}/llvm-strip"
3536

3637
target_triple_flags = "--target=x86_64-fuchsia"
38+
if (target_cpu == "arm64") {
39+
target_triple_flags = "--target=aarch64-fuchsia"
40+
}
41+
3742
sysroot_flags = "--sysroot ${fuchsia_sdk}/arch/${target_cpu}/sysroot"
3843
lto_flags = ""
3944

@@ -129,6 +134,11 @@ toolchain("fuchsia") {
129134
exename = "{{target_output_name}}{{output_extension}}"
130135
outfile = "{{root_out_dir}}/$exename"
131136
rspfile = "$outfile.rsp"
137+
138+
# Note that the unstripped_outfile is in the exe.stripped folder.
139+
# We should probably clean this up, but changing this and dart.cmx
140+
# to point ./dart instead of ./exe.stripped/dart makes the build
141+
# fail because ./dart does not end up in the manifest file.
132142
unstripped_outfile = "{{root_out_dir}}/exe.stripped/$exename"
133143
command = "$compiler_prefix $ld $target_triple_flags $sysroot_flags $lto_flags {{ldflags}} -o $unstripped_outfile -Wl,--build-id -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${strip} -o $outfile $unstripped_outfile"
134144
description = "LINK $outfile"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class AddNullCheck extends CorrectionProducer {
4141
toType = parent.declaredElement.type;
4242
} else if (parent is ArgumentList) {
4343
toType = target.staticParameterElement.type;
44+
} else if (parent is IndexExpression) {
45+
toType = parent.realTarget.staticType;
4446
} else {
4547
return;
4648
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,9 @@ class FixProcessor extends BaseProcessor {
814814
CreateClass.newInstance,
815815
CreateMixin.newInstance,
816816
],
817+
CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE: [
818+
AddNullCheck.newInstance,
819+
],
817820
CompileTimeErrorCode.UNDEFINED_ANNOTATION: [
818821
ChangeTo.annotation,
819822
CreateClass.newInstance,

pkg/analysis_server/test/src/services/correction/fix/add_null_check_test.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,19 @@ class A {
9797
''');
9898
}
9999

100+
Future<void> test_indexExpression() async {
101+
await resolveTestCode('''
102+
void f (List<String>? args) {
103+
print(args[0]);
104+
}
105+
''');
106+
await assertHasFix('''
107+
void f (List<String>? args) {
108+
print(args![0]);
109+
}
110+
''');
111+
}
112+
100113
Future<void> test_initializer() async {
101114
await resolveTestCode('''
102115
void f(int? x) {

pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3973,7 +3973,8 @@ class BodyBuilder extends ScopeListener<JumpTarget>
39733973
/// name.
39743974
void pushQualifiedReference(Token start, Token periodBeforeName) {
39753975
assert(checkState(start, [
3976-
/*suffix*/ if (periodBeforeName != null) ValueKinds.Identifier,
3976+
/*suffix*/ if (periodBeforeName != null)
3977+
unionOfKinds([ValueKinds.Identifier, ValueKinds.ParserRecovery]),
39773978
/*type arguments*/ ValueKinds.TypeArgumentsOrNull,
39783979
/*type*/ unionOfKinds([
39793980
ValueKinds.Generator,
@@ -3982,7 +3983,18 @@ class BodyBuilder extends ScopeListener<JumpTarget>
39823983
ValueKinds.ParserRecovery
39833984
])
39843985
]));
3985-
Identifier suffix = popIfNotNull(periodBeforeName);
3986+
Object suffixObject = popIfNotNull(periodBeforeName);
3987+
Identifier suffix;
3988+
if (suffixObject is Identifier) {
3989+
suffix = suffixObject;
3990+
} else {
3991+
assert(
3992+
suffixObject == null || suffixObject is ParserRecovery,
3993+
"Unexpected qualified name suffix $suffixObject "
3994+
"(${suffixObject.runtimeType})");
3995+
// There was a `.` without a suffix.
3996+
}
3997+
39863998
Identifier identifier;
39873999
List<UnresolvedType> typeArguments = pop();
39884000
Object type = pop();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) 2020, 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+
test() {
6+
Set<int>.();
7+
}
8+
9+
main() {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
library;
2+
import self as self;
3+
4+
static method test() → dynamic
5+
;
6+
static method main() → dynamic
7+
;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
library;
2+
//
3+
// Problems in library:
4+
//
5+
// pkg/front_end/testcases/general/issue44347.dart:6:12: Error: Expected an identifier, but got '('.
6+
// Try inserting an identifier before '('.
7+
// Set<int>.();
8+
// ^
9+
//
10+
import self as self;
11+
import "dart:collection" as col;
12+
import "dart:core" as core;
13+
14+
static method test() → dynamic {
15+
col::LinkedHashSet::•<core::int*>();
16+
}
17+
static method main() → dynamic {}

0 commit comments

Comments
 (0)