diff --git a/pkg/front_end/test/spell_checking_list_common.txt b/pkg/front_end/test/spell_checking_list_common.txt index 86ae2aa3378..b8a5ce2b833 100644 --- a/pkg/front_end/test/spell_checking_list_common.txt +++ b/pkg/front_end/test/spell_checking_list_common.txt @@ -251,6 +251,7 @@ best bets better between +beyond big bigint binaries diff --git a/pkg/front_end/testcases/general/error_locations/error_location_05.dart b/pkg/front_end/testcases/general/error_locations/error_location_05.dart new file mode 100644 index 00000000000..98a013da369 --- /dev/null +++ b/pkg/front_end/testcases/general/error_locations/error_location_05.dart @@ -0,0 +1,7 @@ +// 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. + +library error_location_05; + +part 'error_location_05_lib1.dart'; diff --git a/pkg/front_end/testcases/general/error_locations/error_location_05.dart.outline.expect b/pkg/front_end/testcases/general/error_locations/error_location_05.dart.outline.expect new file mode 100644 index 00000000000..ee7a72e6c08 --- /dev/null +++ b/pkg/front_end/testcases/general/error_locations/error_location_05.dart.outline.expect @@ -0,0 +1,18 @@ +library error_location_05; +// +// Problems in library: +// +// pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart:7:8: Error: Duplicated parameter name 'z'. +// x1(z, {z}) {} +// ^ +// pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart:7:4: Context: Other parameter named 'z'. +// x1(z, {z}) {} +// ^ +// +import self as self; + +part error_location_05_lib1.dart; +static method /* from org-dartlang-testcase:///error_location_05_lib1.dart */ x1(dynamic z, {dynamic z}) → dynamic + ; +static method /* from org-dartlang-testcase:///error_location_05_lib1.dart */ x2() → dynamic + ; diff --git a/pkg/front_end/testcases/general/error_locations/error_location_05.dart.strong.expect b/pkg/front_end/testcases/general/error_locations/error_location_05.dart.strong.expect new file mode 100644 index 00000000000..a52047a7ed5 --- /dev/null +++ b/pkg/front_end/testcases/general/error_locations/error_location_05.dart.strong.expect @@ -0,0 +1,30 @@ +library error_location_05; +// +// Problems in library: +// +// pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart:7:8: Error: Duplicated parameter name 'z'. +// x1(z, {z}) {} +// ^ +// pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart:7:4: Context: Other parameter named 'z'. +// x1(z, {z}) {} +// ^ +// +// pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart:10:9: Error: 'z' is already declared in this scope. +// y(z, {z}) {} +// ^ +// pkg/front_end/testcases/general/error_locations/error_location_05.dart:7:27: Context: Previous declaration of 'z'. +// part 'error_location_05_lib1.dart'; +// ^ +// +import self as self; +import "dart:core" as core; + +part error_location_05_lib1.dart; +static method /* from org-dartlang-testcase:///error_location_05_lib1.dart */ x1(dynamic z = #C1, {dynamic z = #C1}) → dynamic {} +static method /* from org-dartlang-testcase:///error_location_05_lib1.dart */ x2() → dynamic { + function y(dynamic z, {dynamic z = #C1}) → core::Null? {} +} + +constants { + #C1 = null +} diff --git a/pkg/front_end/testcases/general/error_locations/error_location_05.dart.strong.transformed.expect b/pkg/front_end/testcases/general/error_locations/error_location_05.dart.strong.transformed.expect new file mode 100644 index 00000000000..a52047a7ed5 --- /dev/null +++ b/pkg/front_end/testcases/general/error_locations/error_location_05.dart.strong.transformed.expect @@ -0,0 +1,30 @@ +library error_location_05; +// +// Problems in library: +// +// pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart:7:8: Error: Duplicated parameter name 'z'. +// x1(z, {z}) {} +// ^ +// pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart:7:4: Context: Other parameter named 'z'. +// x1(z, {z}) {} +// ^ +// +// pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart:10:9: Error: 'z' is already declared in this scope. +// y(z, {z}) {} +// ^ +// pkg/front_end/testcases/general/error_locations/error_location_05.dart:7:27: Context: Previous declaration of 'z'. +// part 'error_location_05_lib1.dart'; +// ^ +// +import self as self; +import "dart:core" as core; + +part error_location_05_lib1.dart; +static method /* from org-dartlang-testcase:///error_location_05_lib1.dart */ x1(dynamic z = #C1, {dynamic z = #C1}) → dynamic {} +static method /* from org-dartlang-testcase:///error_location_05_lib1.dart */ x2() → dynamic { + function y(dynamic z, {dynamic z = #C1}) → core::Null? {} +} + +constants { + #C1 = null +} diff --git a/pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart b/pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart new file mode 100644 index 00000000000..f896142d63e --- /dev/null +++ b/pkg/front_end/testcases/general/error_locations/error_location_05_lib1.dart @@ -0,0 +1,11 @@ +// 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. + +part of error_location_05; + +x1(z, {z}) {} + +x2() { + y(z, {z}) {} +} diff --git a/pkg/front_end/testcases/general/error_locations/error_location_06.dart b/pkg/front_end/testcases/general/error_locations/error_location_06.dart new file mode 100644 index 00000000000..b97ac236c37 --- /dev/null +++ b/pkg/front_end/testcases/general/error_locations/error_location_06.dart @@ -0,0 +1,7 @@ +// 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. + +library error_location_06; + +part 'error_location_06_lib1.dart'; diff --git a/pkg/front_end/testcases/general/error_locations/error_location_06.dart.outline.expect b/pkg/front_end/testcases/general/error_locations/error_location_06.dart.outline.expect new file mode 100644 index 00000000000..6f0dc86f762 --- /dev/null +++ b/pkg/front_end/testcases/general/error_locations/error_location_06.dart.outline.expect @@ -0,0 +1,18 @@ +library error_location_06; +// +// Problems in library: +// +// pkg/front_end/testcases/general/error_locations/error_location_06_lib1.dart:12:8: Error: Duplicated parameter name 'z'. +// x1(z, {z}) {} +// ^ +// pkg/front_end/testcases/general/error_locations/error_location_06_lib1.dart:12:4: Context: Other parameter named 'z'. +// x1(z, {z}) {} +// ^ +// +import self as self; + +part error_location_06_lib1.dart; +static method /* from org-dartlang-testcase:///error_location_06_lib1.dart */ x1(dynamic z, {dynamic z}) → dynamic + ; +static method /* from org-dartlang-testcase:///error_location_06_lib1.dart */ x2() → dynamic + ; diff --git a/pkg/front_end/testcases/general/error_locations/error_location_06_lib1.dart b/pkg/front_end/testcases/general/error_locations/error_location_06_lib1.dart new file mode 100644 index 00000000000..47a8883fc9b --- /dev/null +++ b/pkg/front_end/testcases/general/error_locations/error_location_06_lib1.dart @@ -0,0 +1,16 @@ +// 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. + +// Lots of comment lines that pushes the length of this file beyond that of +// error_location_06. This in turn causes the (first) 'z' in 'x2' to get an +// offset that is larger than the largest valid offset in error_location_06. +// This in turn can cause a crash, if the fileUri for that z is the wrong file. + +part of error_location_06; + +x1(z, {z}) {} + +x2() { + y(z, {z}) {} +} diff --git a/pkg/front_end/testcases/strong.status b/pkg/front_end/testcases/strong.status index 631d8d53648..e3eb239cdef 100644 --- a/pkg/front_end/testcases/strong.status +++ b/pkg/front_end/testcases/strong.status @@ -6,6 +6,9 @@ # Kernel ASTs directly, that is, code in pkg/fasta/lib/src/kernel/ with # strong-mode enabled. +general/error_locations/error_location_05: RuntimeError # Has errors in it. +general/error_locations/error_location_06: Crash # Has errors in it. + extensions/instance_access_of_static: RuntimeError extensions/invalid_explicit_access: RuntimeError extensions/static_access_of_instance: RuntimeError diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status index 05fec194ac8..f8bdbecfa1e 100644 --- a/pkg/front_end/testcases/text_serialization.status +++ b/pkg/front_end/testcases/text_serialization.status @@ -131,6 +131,8 @@ general/error_locations/error_location_01: TextSerializationFailure general/error_locations/error_location_02: TextSerializationFailure general/error_locations/error_location_03: TextSerializationFailure general/error_locations/error_location_04: TextSerializationFailure +general/error_locations/error_location_05: TextSerializationFailure +general/error_locations/error_location_06: Crash general/escape: TextSerializationFailure # Was: Pass general/export_main: TextSerializationFailure # Was: Pass general/export_test: TextSerializationFailure # Was: Pass