| 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 | 4 |
| 5 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
| 6 | 6 |
| 7 import com.google.common.annotations.VisibleForTesting; | 7 import com.google.common.annotations.VisibleForTesting; |
| 8 import com.google.common.collect.Lists; | 8 import com.google.common.collect.Lists; |
| 9 import com.google.common.collect.Sets; | 9 import com.google.common.collect.Sets; |
| 10 import com.google.dart.compiler.DartCompilationPhase; | 10 import com.google.dart.compiler.DartCompilationPhase; |
| (...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 @Override | 1386 @Override |
| 1387 public Element visitUnqualifiedInvocation(DartUnqualifiedInvocation x) { | 1387 public Element visitUnqualifiedInvocation(DartUnqualifiedInvocation x) { |
| 1388 Scope scope = getContext().getScope(); | 1388 Scope scope = getContext().getScope(); |
| 1389 Element element = scope.findElement(scope.getLibrary(), x.getTarget().getN
ame()); | 1389 Element element = scope.findElement(scope.getLibrary(), x.getTarget().getN
ame()); |
| 1390 ElementKind kind = ElementKind.of(element); | 1390 ElementKind kind = ElementKind.of(element); |
| 1391 if (!INVOKABLE_ELEMENTS.contains(kind)) { | 1391 if (!INVOKABLE_ELEMENTS.contains(kind)) { |
| 1392 diagnoseErrorInUnqualifiedInvocation(x); | 1392 diagnoseErrorInUnqualifiedInvocation(x); |
| 1393 } else { | 1393 } else { |
| 1394 checkInvocationTarget(x, currentMethod, element); | 1394 checkInvocationTarget(x, currentMethod, element); |
| 1395 } | 1395 } |
| 1396 if (Elements.isAbstractFieldWithoutGetter(element)) { |
| 1397 String name = element.getName(); |
| 1398 if (isStaticContextOrInitializer()) { |
| 1399 onError(x.getTarget(), ResolverErrorCode.USE_ASSIGNMENT_ON_SETTER, nam
e); |
| 1400 } else { |
| 1401 onError(x.getTarget(), TypeErrorCode.USE_ASSIGNMENT_ON_SETTER, name); |
| 1402 } |
| 1403 } |
| 1396 recordElement(x, element); | 1404 recordElement(x, element); |
| 1397 recordElement(x.getTarget(), element); | 1405 recordElement(x.getTarget(), element); |
| 1398 visit(x.getArguments()); | 1406 visit(x.getArguments()); |
| 1399 return null; | 1407 return null; |
| 1400 } | 1408 } |
| 1401 | 1409 |
| 1402 @Override | 1410 @Override |
| 1403 public Element visitFunctionObjectInvocation(DartFunctionObjectInvocation x)
{ | 1411 public Element visitFunctionObjectInvocation(DartFunctionObjectInvocation x)
{ |
| 1404 x.getTarget().accept(this); | 1412 x.getTarget().accept(this); |
| 1405 visit(x.getArguments()); | 1413 visit(x.getArguments()); |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2209 ClassElement currentClass = (ClassElement) constructor.getEnclosingEle
ment(); | 2217 ClassElement currentClass = (ClassElement) constructor.getEnclosingEle
ment(); |
| 2210 if (nextClass == currentClass) { | 2218 if (nextClass == currentClass) { |
| 2211 return (ConstructorNodeElement) nextConstructorElement; | 2219 return (ConstructorNodeElement) nextConstructorElement; |
| 2212 } | 2220 } |
| 2213 } | 2221 } |
| 2214 } | 2222 } |
| 2215 } | 2223 } |
| 2216 return null; | 2224 return null; |
| 2217 } | 2225 } |
| 2218 } | 2226 } |
| OLD | NEW |