OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 var assert = chai.assert; | 5 var assert = chai.assert; |
6 var core = dart_library.import('dart/core'); | 6 var core = dart_library.import('dart/core'); |
7 var collection = dart_library.import('dart/collection'); | 7 var collection = dart_library.import('dart/collection'); |
8 var dart = dart_library.import('dart_runtime/dart'); | 8 var dart = dart_library.import('dart_runtime/dart'); |
9 var dartx = dart.dartx; | 9 var dartx = dart.dartx; |
10 | 10 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 checkType(bar1, functionType(B, [B, String]), false); | 402 checkType(bar1, functionType(B, [B, String]), false); |
403 checkType(cls1, functionType(B, [B, String]), false); | 403 checkType(cls1, functionType(B, [B, String]), false); |
404 checkType(bar2, Foo, false); | 404 checkType(bar2, Foo, false); |
405 checkType(cls2, Foo, false); | 405 checkType(cls2, Foo, false); |
406 checkType(bar2, functionType(B, [B, String]), false); | 406 checkType(bar2, functionType(B, [B, String]), false); |
407 checkType(cls2, functionType(B, [B, String]), false); | 407 checkType(cls2, functionType(B, [B, String]), false); |
408 checkType(bar3, Foo); | 408 checkType(bar3, Foo); |
409 checkType(cls3, Foo); | 409 checkType(cls3, Foo); |
410 checkType(bar3, functionType(B, [B, String])); | 410 checkType(bar3, functionType(B, [B, String])); |
411 checkType(cls3, functionType(B, [B, String])); | 411 checkType(cls3, functionType(B, [B, String])); |
412 checkType(bar4, Foo, false); | 412 checkType(bar4, Foo, true); |
413 checkType(cls4, Foo, false); | 413 checkType(cls4, Foo, true); |
414 // TODO(vsm): Revisit. bar4 is (B, *) -> B. Perhaps it should be treated a
s top for a reified object. | 414 checkType(bar4, functionType(B, [B, String]), true); |
415 checkType(bar4, functionType(B, [B, String]), false); | 415 checkType(cls4, functionType(B, [B, String]), true); |
416 checkType(cls4, functionType(B, [B, String]), false); | |
417 checkType(bar5, Foo); | 416 checkType(bar5, Foo); |
418 checkType(cls5, Foo); | 417 checkType(cls5, Foo); |
419 checkType(bar5, functionType(B, [B, String])); | 418 checkType(bar5, functionType(B, [B, String])); |
420 checkType(cls5, functionType(B, [B, String])); | 419 checkType(cls5, functionType(B, [B, String])); |
421 checkType(bar6, Foo, false); | 420 checkType(bar6, Foo, false); |
422 checkType(cls6, Foo, false); | 421 checkType(cls6, Foo, false); |
423 checkType(bar6, functionType(B, [B, String]), false); | 422 checkType(bar6, functionType(B, [B, String]), false); |
424 checkType(cls6, functionType(B, [B, String]), false); | 423 checkType(cls6, functionType(B, [B, String]), false); |
425 checkType(bar7, Foo); | 424 checkType(bar7, Foo); |
426 checkType(cls7, Foo); | 425 checkType(cls7, Foo); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 | 729 |
731 suite('primitives', function() { | 730 suite('primitives', function() { |
732 'use strict'; | 731 'use strict'; |
733 | 732 |
734 test('fixed length list', () => { | 733 test('fixed length list', () => { |
735 let list = new core.List(10); | 734 let list = new core.List(10); |
736 list[0] = 42; | 735 list[0] = 42; |
737 assert.throws(() => list.add(42)); | 736 assert.throws(() => list.add(42)); |
738 }); | 737 }); |
739 }); | 738 }); |
OLD | NEW |