// Copyright (c) 2011, 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. // Dart test for generic types. import "package:expect/expect.dart"; abstract class GenericsTest implements Map { static int myFunc(bool a, bool b) { Expect.equals(true, a); Expect.equals(false, b); return 42; } static void testMain() { int a = 1; int b = 2; int c = 3; int d = 4; Expect.equals(true, a < b); Expect.equals(42, myFunc(a < b, c > d)); Map e; GenericsTest> f; e = new Map(); takesMapMethod(e); Expect.equals(2, e[0]); Map h = new Map(); } static void takesMapMethod(Map m) { m[0] = 2; } Map returnMap() { return null; } } class LongGeneric {} class LongerGeneric { void func() { LongGeneric, Map>>> id; LongGeneric, LongGeneric, Map>>>> id2; } } main() { GenericsTest.testMain(); }