Version 2.14.0-391.0.dev
Merge commit '8f853bc32f0c1cbad0e0de6b8154fb2685059e67' into 'dev'
diff --git a/.packages b/.packages
index 764746a..3b46619 100644
--- a/.packages
+++ b/.packages
@@ -52,7 +52,6 @@
http_io:third_party/pkg_tested/http_io/lib
http_multi_server:third_party/pkg/http_multi_server/lib
http_parser:third_party/pkg/http_parser/lib
-http_retry:third_party/pkg/http_retry/lib
http_throttle:third_party/pkg/http_throttle/lib
intl:third_party/pkg/intl/lib
js:pkg/js/lib
diff --git a/DEPS b/DEPS
index 288bd01..e33bf57 100644
--- a/DEPS
+++ b/DEPS
@@ -106,7 +106,7 @@
# For more details, see https://github.com/dart-lang/sdk/issues/30164
"dart_style_rev": "06bfd19593ed84dd288f67e02c6a753e6516288a",
- "dartdoc_rev" : "c9621b92c738ec21a348cc2de032858276e9c774",
+ "dartdoc_rev" : "5f39ec674d81f5c199151d823fa4ecd01fc59eb2",
"devtools_rev" : "64cffbed6366329ad05e44d48fa2298367643bb6",
"jsshell_tag": "version:88.0",
"ffi_rev": "4dd32429880a57b64edaf54c9d5af8a9fa9a4ffb",
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart
index d5538cc..2b0b5a5 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart
@@ -18,6 +18,61 @@
@reflectiveTest
class UndefinedIdentifierTest extends PubPackageResolutionTest
with WithoutNullSafetyMixin {
+ test_annotation_favors_scope_resolution_over_this_resolution_class() async {
+ // If an annotation on a class type parameter cannot be resolved using the
+ // normal scope resolution mechanism, it is resolved via implicit `this`.
+ // Note: this behavior doesn't match the spec so we may change it - see
+ // https://github.com/dart-lang/language/issues/1790
+ await assertNoErrorsInCode('''
+class C<@Annotation.function(foo) @Annotation.type(B) T> {
+ static void foo() {}
+ static void B() {}
+}
+class B {}
+class Annotation {
+ const Annotation.function(void Function() f);
+ const Annotation.type(Type t);
+}
+''');
+ }
+
+ test_annotation_favors_scope_resolution_over_this_resolution_extension() async {
+ // If an annotation on an extension type parameter cannot be resolved using
+ // the normal scope resolution mechanism, it is resolved via implicit
+ // `this`. Note: this behavior doesn't match the spec so we may change it -
+ // see https://github.com/dart-lang/language/issues/1790
+ await assertNoErrorsInCode('''
+extension E<@Annotation.function(foo) @Annotation.type(B) T> on C {}
+class C {
+ static void foo() {}
+ static void B() {}
+}
+class B {}
+class Annotation {
+ const Annotation.function(void Function() f);
+ const Annotation.type(Type t);
+}
+''');
+ }
+
+ test_annotation_favors_scope_resolution_over_this_resolution_mixin() async {
+ // If an annotation on a mixin type parameter cannot be resolved using the
+ // normal scope resolution mechanism, it is resolved via implicit `this`.
+ // Note: this behavior doesn't match the spec so we may change it - see
+ // https://github.com/dart-lang/language/issues/1790
+ await assertNoErrorsInCode('''
+mixin M<@Annotation.function(foo) @Annotation.type(B) T> {
+ static void foo() {}
+ static void B() {}
+}
+class B {}
+class Annotation {
+ const Annotation.function(void Function() f);
+ const Annotation.type(Type t);
+}
+''');
+ }
+
test_annotation_references_static_method_in_class() async {
await assertErrorsInCode('''
@Annotation(foo)
@@ -33,6 +88,21 @@
]);
}
+ test_annotation_references_static_method_in_class_from_type_parameter() async {
+ // It is allowed for an annotation of a class type parameter to refer to
+ // a method in a class (note: this doesn't match the spec but we currently
+ // test it to make sure we match CFE behavior - see
+ // https://github.com/dart-lang/language/issues/1790)
+ await assertNoErrorsInCode('''
+class C<@Annotation(foo) T> {
+ static void foo() {}
+}
+class Annotation {
+ const Annotation(dynamic d);
+}
+''');
+ }
+
test_annotation_references_static_method_in_extension() async {
await assertErrorsInCode('''
@Annotation(foo)
@@ -48,6 +118,21 @@
]);
}
+ test_annotation_references_static_method_in_extension_from_type_parameter() async {
+ // It is allowed for an annotation of a mixin type parameter to refer to
+ // a method in a class (note: this doesn't match the spec but we currently
+ // test it to make sure we match CFE behavior - see
+ // https://github.com/dart-lang/language/issues/1790)
+ await assertNoErrorsInCode('''
+extension E<@Annotation(foo) T> on T {
+ static void foo() {}
+}
+class Annotation {
+ const Annotation(dynamic d);
+}
+''');
+ }
+
test_annotation_references_static_method_in_mixin() async {
await assertErrorsInCode('''
@Annotation(foo)
@@ -63,6 +148,21 @@
]);
}
+ test_annotation_references_static_method_in_mixin_from_type_parameter() async {
+ // It is allowed for an annotation of a mixin type parameter to refer to
+ // a method in a class (note: this doesn't match the spec but we currently
+ // test it to make sure we match CFE behavior - see
+ // https://github.com/dart-lang/language/issues/1790)
+ await assertNoErrorsInCode('''
+mixin M<@Annotation(foo) T> {
+ static void foo() {}
+}
+class Annotation {
+ const Annotation(dynamic d);
+}
+''');
+ }
+
@failingTest
test_commentReference() async {
await assertErrorsInCode('''
diff --git a/pkg/compiler/lib/src/ssa/ssa_tracer.dart b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
index f0fa679..d25cbd8 100644
--- a/pkg/compiler/lib/src/ssa/ssa_tracer.dart
+++ b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
@@ -370,8 +370,15 @@
String target = "$receiver.$name";
int offset = HInvoke.ARGUMENTS_OFFSET;
List arguments = invoke.inputs.sublist(offset);
+ final attributes = {
+ if (invoke.isInvariant) 'Invariant',
+ if (invoke.isBoundsSafe) 'BoundSafe',
+ };
+ String attributesText = attributes.isEmpty ? '' : ' $attributes';
+
return handleGenericInvoke(kind, target, arguments) +
- "(${invoke.receiverType})";
+ "(${invoke.receiverType})" +
+ attributesText;
}
@override
diff --git a/pkg/compiler/test/kernel/data/list_generate_2.dart.expect b/pkg/compiler/test/kernel/data/list_generate_2.dart.expect
index b58c1b6..c87b037 100644
--- a/pkg/compiler/test/kernel/data/list_generate_2.dart.expect
+++ b/pkg/compiler/test/kernel/data/list_generate_2.dart.expect
@@ -13,7 +13,7 @@
final _in::JSArray<core::int*> _list = _in::JSArray::allocateGrowable<core::int*>(_length);
for (core::int i = 0; i.{core::num::<}(_length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::int) →* core::int}) {
core::int* i = i;
- _list.{_in::JSArray::[]=}(i, i.{core::num::+}(1){(core::num*) →* core::int*}){(core::int, core::int*) → void};
+ _list.{_in::JSArray::[]=}{Invariant,BoundsSafe}(i, i.{core::num::+}(1){(core::num*) →* core::int*}){(core::int, core::int*) → void};
}
} =>_list){(core::int, core::List<core::int*>*) → void};
}
diff --git a/pkg/front_end/testcases/incremental/no_outline_change_22.yaml.world.1.expect b/pkg/front_end/testcases/incremental/no_outline_change_22.yaml.world.1.expect
index d6a452a..e32d117 100644
--- a/pkg/front_end/testcases/incremental/no_outline_change_22.yaml.world.1.expect
+++ b/pkg/front_end/testcases/incremental/no_outline_change_22.yaml.world.1.expect
@@ -304,7 +304,7 @@
operator /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ +(generic-covariant-impl dart.core::List<dart.core::int*> other) → dart.core::List<dart.core::int*>
return block {
final dart.core::List<dart.core::int*> #t5 = dart.core::List::of<dart.core::int*>(this);
- #t5.{dart.core::List::addAll}(other){(dart.core::Iterable<dart.core::int*>) → void};
+ #t5.{dart.core::List::addAll}{Invariant}(other){(dart.core::Iterable<dart.core::int*>) → void};
} =>#t5;
method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sublist(dart.core::int start, [dart.core::int? end = #C2]) → dart.core::List<dart.core::int*> {
dart.core::int listLength = this.{dart.core::List::length}{dart.core::int};
diff --git a/pkg/front_end/testcases/incremental/no_outline_change_22.yaml.world.2.expect b/pkg/front_end/testcases/incremental/no_outline_change_22.yaml.world.2.expect
index d6a452a..e32d117 100644
--- a/pkg/front_end/testcases/incremental/no_outline_change_22.yaml.world.2.expect
+++ b/pkg/front_end/testcases/incremental/no_outline_change_22.yaml.world.2.expect
@@ -304,7 +304,7 @@
operator /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ +(generic-covariant-impl dart.core::List<dart.core::int*> other) → dart.core::List<dart.core::int*>
return block {
final dart.core::List<dart.core::int*> #t5 = dart.core::List::of<dart.core::int*>(this);
- #t5.{dart.core::List::addAll}(other){(dart.core::Iterable<dart.core::int*>) → void};
+ #t5.{dart.core::List::addAll}{Invariant}(other){(dart.core::Iterable<dart.core::int*>) → void};
} =>#t5;
method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sublist(dart.core::int start, [dart.core::int? end = #C2]) → dart.core::List<dart.core::int*> {
dart.core::int listLength = this.{dart.core::List::length}{dart.core::int};
diff --git a/pkg/kernel/lib/clone.dart b/pkg/kernel/lib/clone.dart
index c18ffb7..c65b3a2 100644
--- a/pkg/kernel/lib/clone.dart
+++ b/pkg/kernel/lib/clone.dart
@@ -677,7 +677,8 @@
return new InstanceInvocation.byReference(
node.kind, clone(node.receiver), node.name, clone(node.arguments),
functionType: visitType(node.functionType) as FunctionType,
- interfaceTargetReference: node.interfaceTargetReference);
+ interfaceTargetReference: node.interfaceTargetReference)
+ ..flags = node.flags;
}
@override
diff --git a/tools/VERSION b/tools/VERSION
index 13fcb01..d820e4a 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 390
+PRERELEASE 391
PRERELEASE_PATCH 0
\ No newline at end of file