// 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. // This is a regression test for http://dartbug.com/40600. import 'dart:async'; class B { bar(FutureOr y) {} } class A { final b = new B(); foo([FutureOr? x]) { if (x is Future) { b.bar(x as FutureOr); } } } class C { FutureOr baz>(FutureOr x) => x; } class D extends C { FutureOr baz>(FutureOr x) => x; } main() {}