OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |