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

Unified Diff: frog/tests/leg/resolver_test.dart

Issue 10349008: Set the right context to resolve types of fields, closures and parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge and add test. Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/tests/leg/resolver_test.dart
diff --git a/frog/tests/leg/resolver_test.dart b/frog/tests/leg/resolver_test.dart
index c7d3be9ac0d67bb058870c28e72275321d4532a4..b728f53eafc347751b585090402be74e545e06d4 100644
--- a/frog/tests/leg/resolver_test.dart
+++ b/frog/tests/leg/resolver_test.dart
@@ -113,6 +113,20 @@ testTypeVariables() {
Expect.equals(1, compiler.errors.length);
Expect.equals(MessageKind.CANNOT_RESOLVE_TYPE,
compiler.errors[0].message.kind);
+
+ compiler = new MockCompiler();
+ compiler.parseScript('class Foo<T> {'
+ ' Foo<T> t;'
+ ' foo(Foo<T> f) {}'
+ ' bar() { g(Foo<T> f) {}; g(); }'
+ '}');
+ foo = compiler.mainApp.find(buildSourceString('Foo'));
+ compiler.resolveClass(foo);
+ foo.lookupLocalMember(buildSourceString('t')).computeType(compiler);;
+ foo.lookupLocalMember(buildSourceString('foo')).computeType(compiler);;
+ compiler.resolver.resolve(foo.lookupLocalMember(buildSourceString('bar')));
+ Expect.equals(0, compiler.warnings.length);
+ Expect.equals(0, compiler.errors.length);
}
testSuperCalls() {
« no previous file with comments | « no previous file | lib/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698