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

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

Issue 23190035: Distinguish between malformed and malbounded types (fix issues 12552 and 12554). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | « runtime/vm/parser.cc ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 // Test for F-Bounded Quantification.
6
7 import "package:expect/expect.dart";
8
9 class A<T extends B<T>> {
10 }
11
12 class B<T extends A<T>> {
13 }
14
15 isCheckedMode() {
16 try {
17 var i = 1;
18 String s = i;
19 return false;
20 } catch (e) {
21 return true;
22 }
23 }
24
25 main() {
26 bool got_type_error = false;
27 try {
28 Expect.equals("A<B<int>>", new A<B<int>>().runtimeType.toString());
29 } on TypeError catch (error) {
30 got_type_error = true;
31 }
32 // Type error expected in checked mode only.
33 Expect.isTrue(got_type_error == isCheckedMode());
34 }
35
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698