// 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. import 'package:expect/expect.dart'; abstract class Foo { bool pip(o); } class Bar implements Foo { bool pip(o) => o is Y; } class Baz implements Foo { bool pip(o) => true; } void main() { Expect.listEquals([], test(1)); Expect.listEquals([true, false], test(Bar())); Expect.listEquals([true, true], test(Baz())); } @pragma('dart2js:noInline') List test(dynamic p) { List result = []; if (p is Foo) { for (var o in [1, 'x']) { result.add(p.pip(o)); } } return result; }