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

Side by Side Diff: tests/compiler/dart2js/resolver_test.dart

Issue 1421003004: Add CoreClasses (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 1 month 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
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 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:collection'; 6 import 'dart:collection';
7 7
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/constants/expressions.dart'; 10 import 'package:compiler/src/constants/expressions.dart';
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 Expect.equals(index, expectedElements.length); 157 Expect.equals(index, expectedElements.length);
158 } 158 }
159 159
160 return Future.wait([ 160 return Future.wait([
161 MockCompiler.create((MockCompiler compiler) { 161 MockCompiler.create((MockCompiler compiler) {
162 ResolverVisitor visitor = compiler.resolverVisitor(); 162 ResolverVisitor visitor = compiler.resolverVisitor();
163 compiler.parseScript('class Foo<T, U> {}'); 163 compiler.parseScript('class Foo<T, U> {}');
164 ClassElement foo = compiler.mainApp.find('Foo'); 164 ClassElement foo = compiler.mainApp.find('Foo');
165 matchResolvedTypes(visitor, 'Foo<int, String> x;', 'Foo', 165 matchResolvedTypes(visitor, 'Foo<int, String> x;', 'Foo',
166 [compiler.intClass, compiler.stringClass]); 166 [compiler.coreClasses.intClass,
167 compiler.coreClasses.stringClass]);
167 matchResolvedTypes(visitor, 'Foo<Foo, Foo> x;', 'Foo', 168 matchResolvedTypes(visitor, 'Foo<Foo, Foo> x;', 'Foo',
168 [foo, foo]); 169 [foo, foo]);
169 }), 170 }),
170 171
171 MockCompiler.create((MockCompiler compiler) { 172 MockCompiler.create((MockCompiler compiler) {
172 compiler.parseScript('class Foo<T, U> {}'); 173 compiler.parseScript('class Foo<T, U> {}');
173 compiler.resolveStatement('Foo<notype, int> x;'); 174 compiler.resolveStatement('Foo<notype, int> x;');
174 Expect.equals(1, compiler.warnings.length); 175 Expect.equals(1, compiler.warnings.length);
175 Expect.equals(MessageKind.CANNOT_RESOLVE_TYPE, 176 Expect.equals(MessageKind.CANNOT_RESOLVE_TYPE,
176 compiler.warnings[0].message.kind); 177 compiler.warnings[0].message.kind);
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 } 1411 }
1411 main() => A.m(); 1412 main() => A.m();
1412 ''', functionName: 'm'); 1413 ''', functionName: 'm');
1413 check(''' 1414 check('''
1414 class A { 1415 class A {
1415 m() => () => await - 3; 1416 m() => () => await - 3;
1416 } 1417 }
1417 main() => new A().m(); 1418 main() => new A().m();
1418 ''', className: 'A'); 1419 ''', className: 'A');
1419 } 1420 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/related_types.dart ('k') | tests/compiler/dart2js/simple_inferrer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698