| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 class C<T> {} |
| 6 |
| 7 sameType(a, b) { |
| 8 Expect.isTrue(a.runtimeType() === b.runtimeType()); |
| 9 } |
| 10 |
| 11 differentType(a, b) { |
| 12 Expect.isFalse(a.runtimeType() === b.runtimeType()); |
| 13 } |
| 14 |
| 15 main() { |
| 16 var v1 = new C<int>(); |
| 17 var v2 = new C<int>(); |
| 18 sameType(v1, v2); |
| 19 |
| 20 var v3 = new C<num>(); |
| 21 differentType(v1, v3); |
| 22 |
| 23 var i = 1; |
| 24 var s = 'string'; |
| 25 var d = 3.14; |
| 26 sameType(2, i); |
| 27 sameType('hest', s); |
| 28 sameType(1.2, d); |
| 29 |
| 30 var l = [1, 2, 3]; |
| 31 var m = {'a': 1, 'b': 2}; |
| 32 sameType([], l); |
| 33 sameType({}, m); |
| 34 } |
| OLD | NEW |