// Copyright (c) 2017, 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 that a generic closure is correctly constructed. library generic_methods_closure_test; import "package:expect/expect.dart"; class A {} class I {} class B extends I {} void fun(List list) { var helper1 = (List list) { if (list.length > 0) { Expect.isTrue(list[0] is S); } Expect.isTrue(list is List); Expect.isTrue(list is List); }; void helper2(List list) { if (list.length > 0) { Expect.isTrue(list[0] is S); } Expect.isTrue(list is List); Expect.isTrue(list is List); } helper1(list); helper2(list); } main() { List list = [new B()]; fun(list); }