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

Side by Side Diff: compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java

Issue 10006030: Add element to qualifier name for code completion (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added JUnit test Created 8 years, 8 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) 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 package com.google.dart.compiler.resolver; 4 package com.google.dart.compiler.resolver;
5 5
6 import static com.google.dart.compiler.common.ErrorExpectation.assertErrors; 6 import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
7 import static com.google.dart.compiler.common.ErrorExpectation.errEx; 7 import static com.google.dart.compiler.common.ErrorExpectation.errEx;
8 8
9 import com.google.dart.compiler.CompilerTestCase; 9 import com.google.dart.compiler.CompilerTestCase;
10 import com.google.dart.compiler.DartCompilationError; 10 import com.google.dart.compiler.DartCompilationError;
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 "// filler filler filler filler filler filler filler filler fill er filler", 1204 "// filler filler filler filler filler filler filler filler fill er filler",
1205 "class A {}", 1205 "class A {}",
1206 "typedef T Foo<T extends A>();", 1206 "typedef T Foo<T extends A>();",
1207 "")); 1207 ""));
1208 resolve(unit); 1208 resolve(unit);
1209 DartFunctionTypeAlias func = (DartFunctionTypeAlias) unit.getTopLevelNodes() .get(1); 1209 DartFunctionTypeAlias func = (DartFunctionTypeAlias) unit.getTopLevelNodes() .get(1);
1210 DartTypeParameter typeParameter = func.getTypeParameters().get(0); 1210 DartTypeParameter typeParameter = func.getTypeParameters().get(0);
1211 Type boundType = typeParameter.getBound().getType(); 1211 Type boundType = typeParameter.getBound().getType();
1212 assertEquals("A", boundType.getElement().getName()); 1212 assertEquals("A", boundType.getElement().getName());
1213 } 1213 }
1214
1215 public void test_methodCannotBeResolved() throws Exception {
1216 checkSourceErrors(
1217 makeCode(
1218 "class A {",
1219 "}",
1220 "method() {",
1221 " A.method();", // error
1222 "}"),
1223 errEx(ResolverErrorCode.CANNOT_RESOLVE_METHOD_IN_CLASS, 4, 5, 6));
1224 }
1214 } 1225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698