Version 2.14.0-260.0.dev
Merge commit '7e183b64a9b896daf9ce5ffefefe4313c9eebaf3' into 'dev'
diff --git a/pkg/front_end/lib/src/fasta/dill/dill_extension_member_builder.dart b/pkg/front_end/lib/src/fasta/dill/dill_extension_member_builder.dart
index d12400f..07a6d6a 100644
--- a/pkg/front_end/lib/src/fasta/dill/dill_extension_member_builder.dart
+++ b/pkg/front_end/lib/src/fasta/dill/dill_extension_member_builder.dart
@@ -22,6 +22,9 @@
bool get isExternal => member.isExternal;
@override
+ String get name => _descriptor.name.text;
+
+ @override
ProcedureKind get kind {
switch (_descriptor.kind) {
case ExtensionMemberKind.Method:
diff --git a/pkg/front_end/test/incremental_suite.dart b/pkg/front_end/test/incremental_suite.dart
index dbb1cf7..6efa1ec 100644
--- a/pkg/front_end/test/incremental_suite.dart
+++ b/pkg/front_end/test/incremental_suite.dart
@@ -440,6 +440,8 @@
}
int worldNum = 0;
+ // TODO: When needed, we can do this for warnings too.
+ List<Set<String>> worldErrors = [];
for (YamlMap world in worlds) {
worldNum++;
print("----------------");
@@ -891,6 +893,18 @@
}
List<int> incrementalSerializationBytes = serializationResult.output;
+ worldErrors.add(formattedErrors.toSet());
+ assert(worldErrors.length == worldNum);
+ if (world["expectSameErrorsAsWorld"] != null) {
+ int expectSameErrorsAsWorld = world["expectSameErrorsAsWorld"];
+ checkErrorsAndWarnings(
+ worldErrors[expectSameErrorsAsWorld - 1],
+ formattedErrors,
+ {},
+ {},
+ );
+ }
+
Set<String> prevFormattedErrors = formattedErrors.toSet();
Set<String> prevFormattedWarnings = formattedWarnings.toSet();
diff --git a/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml b/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml
new file mode 100644
index 0000000..21d2963
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml
@@ -0,0 +1,62 @@
+# 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.md file.
+
+# This basically first compiles
+# tests/language_2/extension_methods/static_extension_prefix_double_import_test.dart
+# and then compiles
+# tests/language_2/extension_methods/static_extension_prefix_import_conflict_test.dart
+# as this has produced a wrong squigly-length on an error.
+
+type: newworld
+worlds:
+ - entry: main.dart
+ errors: true
+ sources:
+ main.dart: |
+ import "lib1.dart";
+ import "lib2.dart" as p;
+ main() {
+ Object o = 1;
+ o.onObject;
+ }
+ lib1.dart: |
+ extension OnObject on Object {
+ String get onObject => "object #1";
+ }
+ lib2.dart: |
+ extension AlsoOnObject on Object {
+ String get onObject => "object #2";
+ }
+ expectedLibraryCount: 3
+ - entry: main.dart
+ worldType: updated
+ expectInitializeFromDill: false
+ errors: false
+ invalidate:
+ - main.dart
+ sources:
+ main.dart: |
+ import "lib1.dart";
+ import "lib1.dart" as p;
+ main() {
+ Object o = 1;
+ o.onObject;
+ }
+ expectedLibraryCount: 2
+ - entry: main.dart
+ worldType: updated
+ expectInitializeFromDill: false
+ errors: true
+ expectSameErrorsAsWorld: 1
+ invalidate:
+ - main.dart
+ sources:
+ main.dart: |
+ import "lib1.dart";
+ import "lib2.dart" as p;
+ main() {
+ Object o = 1;
+ o.onObject;
+ }
+ expectedLibraryCount: 3
diff --git a/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml.world.1.expect b/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml.world.1.expect
new file mode 100644
index 0000000..fa77b0e
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml.world.1.expect
@@ -0,0 +1,42 @@
+main = main::main;
+library from "org-dartlang-test:///lib1.dart" as lib1 {
+
+ extension OnObject on dart.core::Object* {
+ get onObject = lib1::OnObject|get#onObject;
+ }
+ static method OnObject|get#onObject(lowered final dart.core::Object* #this) → dart.core::String*
+ return "object #1";
+}
+library from "org-dartlang-test:///lib2.dart" as lib2 {
+
+ extension AlsoOnObject on dart.core::Object* {
+ get onObject = lib2::AlsoOnObject|get#onObject;
+ }
+ static method AlsoOnObject|get#onObject(lowered final dart.core::Object* #this) → dart.core::String*
+ return "object #2";
+}
+library from "org-dartlang-test:///main.dart" as main {
+//
+// Problems in library:
+//
+// org-dartlang-test:///main.dart:5:5: Error: The property 'onObject' is defined in multiple extensions for 'Object' and neither is more specific.
+// - 'Object' is from 'dart:core'.
+// Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.
+// o.onObject;
+// ^^^^^^^^
+// org-dartlang-test:///lib1.dart:2:14: Context: This is one of the extension members.
+// String get onObject => "object #1";
+// ^^^^^^^^
+// org-dartlang-test:///lib2.dart:2:14: Context: This is one of the extension members.
+// String get onObject => "object #2";
+// ^^^^^^^^
+//
+
+ import "org-dartlang-test:///lib1.dart";
+ import "org-dartlang-test:///lib2.dart" as p;
+
+ static method main() → dynamic {
+ dart.core::Object* o = 1;
+ invalid-expression "org-dartlang-test:///main.dart:5:5: Error: The property 'onObject' is defined in multiple extensions for 'Object' and neither is more specific.\n - 'Object' is from 'dart:core'.\nTry using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.\n o.onObject;\n ^^^^^^^^";
+ }
+}
diff --git a/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml.world.2.expect b/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml.world.2.expect
new file mode 100644
index 0000000..55a319c
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml.world.2.expect
@@ -0,0 +1,19 @@
+main = main::main;
+library from "org-dartlang-test:///lib1.dart" as lib1 {
+
+ extension OnObject on dart.core::Object* {
+ get onObject = lib1::OnObject|get#onObject;
+ }
+ static method OnObject|get#onObject(lowered final dart.core::Object* #this) → dart.core::String*
+ return "object #1";
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+ import "org-dartlang-test:///lib1.dart";
+ import "org-dartlang-test:///lib1.dart" as p;
+
+ static method main() → dynamic {
+ dart.core::Object* o = 1;
+ lib1::OnObject|get#onObject(o);
+ }
+}
diff --git a/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml.world.3.expect b/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml.world.3.expect
new file mode 100644
index 0000000..fa77b0e
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/extension_prefix_double_import_then_conflict.yaml.world.3.expect
@@ -0,0 +1,42 @@
+main = main::main;
+library from "org-dartlang-test:///lib1.dart" as lib1 {
+
+ extension OnObject on dart.core::Object* {
+ get onObject = lib1::OnObject|get#onObject;
+ }
+ static method OnObject|get#onObject(lowered final dart.core::Object* #this) → dart.core::String*
+ return "object #1";
+}
+library from "org-dartlang-test:///lib2.dart" as lib2 {
+
+ extension AlsoOnObject on dart.core::Object* {
+ get onObject = lib2::AlsoOnObject|get#onObject;
+ }
+ static method AlsoOnObject|get#onObject(lowered final dart.core::Object* #this) → dart.core::String*
+ return "object #2";
+}
+library from "org-dartlang-test:///main.dart" as main {
+//
+// Problems in library:
+//
+// org-dartlang-test:///main.dart:5:5: Error: The property 'onObject' is defined in multiple extensions for 'Object' and neither is more specific.
+// - 'Object' is from 'dart:core'.
+// Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.
+// o.onObject;
+// ^^^^^^^^
+// org-dartlang-test:///lib1.dart:2:14: Context: This is one of the extension members.
+// String get onObject => "object #1";
+// ^^^^^^^^
+// org-dartlang-test:///lib2.dart:2:14: Context: This is one of the extension members.
+// String get onObject => "object #2";
+// ^^^^^^^^
+//
+
+ import "org-dartlang-test:///lib1.dart";
+ import "org-dartlang-test:///lib2.dart" as p;
+
+ static method main() → dynamic {
+ dart.core::Object* o = 1;
+ invalid-expression "org-dartlang-test:///main.dart:5:5: Error: The property 'onObject' is defined in multiple extensions for 'Object' and neither is more specific.\n - 'Object' is from 'dart:core'.\nTry using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.\n o.onObject;\n ^^^^^^^^";
+ }
+}
diff --git a/tests/language/export/duplicate_import_libd.dart b/tests/language/export/duplicate_import_libd.dart
index 14f1ff4..ccec81e 100644
--- a/tests/language/export/duplicate_import_libd.dart
+++ b/tests/language/export/duplicate_import_libd.dart
@@ -8,6 +8,6 @@
import 'duplicate_import_libb.dart';
import 'duplicate_import_libc.dart';
-export '../duplicate_import_liba.dart';
+export 'duplicate_import_liba.dart';
export 'duplicate_import_libb.dart';
export 'duplicate_import_libc.dart';
diff --git a/tests/language_2/export/duplicate_import_libd.dart b/tests/language_2/export/duplicate_import_libd.dart
index 54bd35c..3408bfa 100644
--- a/tests/language_2/export/duplicate_import_libd.dart
+++ b/tests/language_2/export/duplicate_import_libd.dart
@@ -10,6 +10,6 @@
import 'duplicate_import_libb.dart';
import 'duplicate_import_libc.dart';
-export '../duplicate_import_liba.dart';
+export 'duplicate_import_liba.dart';
export 'duplicate_import_libb.dart';
export 'duplicate_import_libc.dart';
diff --git a/tools/VERSION b/tools/VERSION
index 906f90f..4a7410b 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 259
+PRERELEASE 260
PRERELEASE_PATCH 0
\ No newline at end of file