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

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

Issue 897013003: dart2js: add common names to mangledGlobalNames in new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comment. Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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 // Test for F-Bounded Quantification. 5 // Test for F-Bounded Quantification.
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 class A<T extends B<T>> { 9 class A<T extends B<T>> {
10 } 10 }
11 11
12 class B<T extends A<T>> { 12 class B<T extends A<T>> {
13 } 13 }
14 14
15 isCheckedMode() { 15 isCheckedMode() {
16 try { 16 try {
17 var i = 1; 17 var i = 1;
18 String s = i; 18 String s = i;
19 return false; 19 return false;
20 } catch (e) { 20 } catch (e) {
21 return true; 21 return true;
22 } 22 }
23 } 23 }
24 24
25 main() { 25 main() {
26 bool got_type_error = false; 26 bool got_type_error = false;
27 try { 27 try {
28 // Getting "int" when calling toString() on the int type is not required.
29 // However, we want to keep the original names for the most common core
30 // types so we make sure to handle these specifically in the compiler.
28 Expect.equals("A<B<int>>", new A<B<int>>().runtimeType.toString()); 31 Expect.equals("A<B<int>>", new A<B<int>>().runtimeType.toString());
29 } on TypeError catch (error) { 32 } on TypeError catch (error) {
30 got_type_error = true; 33 got_type_error = true;
31 } 34 }
32 // Type error expected in checked mode only. 35 // Type error expected in checked mode only.
33 Expect.isTrue(got_type_error == isCheckedMode()); 36 Expect.isTrue(got_type_error == isCheckedMode());
34 } 37 }
35 38
OLDNEW
« no previous file with comments | « tests/language/cyclic_type_test.dart ('k') | tests/language/mixin_type_parameters_simple_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698