Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: tests/language/type_checks_in_factory_method_test.dart

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/type_cast_vm_test.dart ('k') | tests/language/type_error_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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 // VMOptions=--enable_checked_mode 4 // VMOptions=--enable_checked_mode
5 // Tests the type checking when passing code into closure from inside a factory method 5 // Tests the type checking when passing code into closure from inside a factory method
6 6
7 import "package:expect/expect.dart";
8
9 abstract class Foo<T> { 7 abstract class Foo<T> {
10 factory Foo.from() = Bar<T>.from; 8 factory Foo.from() = Bar<T>.from;
11 } 9 }
12 10
13 class Bar<T> implements Foo<T> { 11 class Bar<T> implements Foo<T> {
14 Bar() {} 12 Bar() {}
15 13
16 factory Bar.from() { 14 factory Bar.from() {
17 var func = (T arg) { 15 var func = (T arg) {
18 T foo = arg; 16 T foo = arg;
(...skipping 13 matching lines...) Expand all
32 30
33 bool gotError = false; 31 bool gotError = false;
34 32
35 try { 33 try {
36 Foo<int> value2 = new Foo<int>.from(); 34 Foo<int> value2 = new Foo<int>.from();
37 } on TypeError catch (e) { 35 } on TypeError catch (e) {
38 gotError = true; 36 gotError = true;
39 } 37 }
40 Expect.equals(true, gotError); 38 Expect.equals(true, gotError);
41 } 39 }
OLDNEW
« no previous file with comments | « tests/language/type_cast_vm_test.dart ('k') | tests/language/type_error_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698