Version 2.11.0-201.0.dev
Merge commit '34e4a6d814c54fabdb209e5368b6d01bb55b8dd4' into 'dev'
diff --git a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
index edb4a54..d237dcf 100644
--- a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
@@ -2361,9 +2361,7 @@
@override
Constant visitIsExpression(IsExpression node) {
- // TODO(jensj): Why does this call .accept directly?
- // (@askesc says it's probably an oversight)
- final Constant constant = node.operand.accept(this);
+ final Constant constant = _evaluateSubexpression(node.operand);
if (constant is AbortConstant) return constant;
if (shouldBeUnevaluated) {
return unevaluated(
diff --git a/tests/language/least_upper_bound/least_upper_bound_fbound_test.dart b/tests/language/least_upper_bound/least_upper_bound_fbound_test.dart
new file mode 100644
index 0000000..9fb032f
--- /dev/null
+++ b/tests/language/least_upper_bound/least_upper_bound_fbound_test.dart
@@ -0,0 +1,50 @@
+// Copyright (c) 2020, 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.
+
+import '../static_type_helper.dart';
+
+// Test least upper bound for a type variable with an F-bound.
+
+bool condition = true;
+
+class A<X extends A<X, X>?, Y extends A<Y, Y>?> {
+ X x;
+ late Y y;
+
+ A(this.x);
+
+ void m(X x, Y y) {
+ // UP(X extends A<X, X>?, Y extends A<Y, Y>?) ==
+ // A<Object?, Object?>?.
+ var z = condition ? x : y;
+ z.expectStaticType<Exactly<A<Object?, Object?>?>>();
+
+ // Distinguish top types.
+ if (z == null) throw 0;
+ var zx = z.x, zy = z.y;
+
+ // Not `dynamic`, not `void`.
+ zx?.whatever;
+ // ^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
+ // [cfe] The getter 'whatever' isn't defined for the class 'Object'.
+ zy?.whatever;
+ // ^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
+ // [cfe] The getter 'whatever' isn't defined for the class 'Object'.
+
+ if (zx == null || zy == null) throw 0;
+ zx.expectStaticType<Exactly<Object>>();
+ zy.expectStaticType<Exactly<Object>>();
+ }
+}
+
+class B<X> extends A<B<X>?, B<X>?> {
+ B() : super(null);
+}
+
+void main() {
+ var b = B<Null>();
+ b.m(b, null);
+}
diff --git a/tests/language/least_upper_bound/least_upper_bound_function_test.dart b/tests/language/least_upper_bound/least_upper_bound_function_test.dart
new file mode 100644
index 0000000..6d0e187
--- /dev/null
+++ b/tests/language/least_upper_bound/least_upper_bound_function_test.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2020, 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.
+
+// Test least upper bound for a Function type and a type that doesn't match
+// any of the cases for function types being subtypes of each other.
+
+import 'dart:async';
+import '../static_type_helper.dart';
+
+bool condition = true;
+
+void main() {
+ void f1(void Function() x, Object y) {
+ var z = condition ? x : y;
+ z.expectStaticType<Exactly<Object>>();
+ }
+
+ void f2(int x, void Function<X>() y) {
+ var z = condition ? x : y;
+ z.expectStaticType<Exactly<Object>>();
+ }
+
+ void f3(double Function(int, int) x, FutureOr<Function> y) {
+ var z = condition ? x : y;
+ z.expectStaticType<Exactly<Object>>();
+ }
+
+ void f4(FutureOr<Function?> x, Function(int i, {int j}) y) {
+ var z = condition ? x : y;
+ z.expectStaticType<Exactly<Object?>>();
+ }
+
+ void f5(Function Function<Y>([Y y]) x, dynamic y) {
+ var z = condition ? x : y;
+ // Check that the type is a top type.
+ z.expectStaticType<Exactly<dynamic>>();
+ // Check that the type is `dynamic`.
+ z.unknownMember;
+ }
+
+ void f6(Never x, Never Function() y) {
+ var z = condition ? x : y;
+ z.expectStaticType<Exactly<Never Function()>>();
+ }
+
+ void f7(Function(Function) x, Null y) {
+ var z = condition ? x : y;
+ z.expectStaticType<Exactly<Object?>>();
+ }
+}
diff --git a/tools/VERSION b/tools/VERSION
index 0fd19c8..178e41b 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 11
PATCH 0
-PRERELEASE 200
+PRERELEASE 201
PRERELEASE_PATCH 0
\ No newline at end of file