| 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 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 Type getType(TypeAnnotation annotation); | 8 Type getType(TypeAnnotation annotation); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 String classNameString = className.slowToString(); | 341 String classNameString = className.slowToString(); |
| 342 String constructorNameString = constructorName.slowToString(); | 342 String constructorNameString = constructorName.slowToString(); |
| 343 String name = (constructorName === const SourceString('')) | 343 String name = (constructorName === const SourceString('')) |
| 344 ? classNameString | 344 ? classNameString |
| 345 : "$classNameString.$constructorNameString"; | 345 : "$classNameString.$constructorNameString"; |
| 346 MessageKind kind = isImplicitSuperCall | 346 MessageKind kind = isImplicitSuperCall |
| 347 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT | 347 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT |
| 348 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR; | 348 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR; |
| 349 error(diagnosticNode, kind, [name]); | 349 error(diagnosticNode, kind, [name]); |
| 350 } else { | 350 } else { |
| 351 final Compiler compiler = visitor.compiler; | 351 if (!selector.applies(result, visitor.compiler)) { |
| 352 FunctionParameters parameters = result.computeParameters(compiler); | |
| 353 if (!selector.applies(parameters)) { | |
| 354 MessageKind kind = isImplicitSuperCall | 352 MessageKind kind = isImplicitSuperCall |
| 355 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT | 353 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT |
| 356 : MessageKind.NO_MATCHING_CONSTRUCTOR; | 354 : MessageKind.NO_MATCHING_CONSTRUCTOR; |
| 357 error(diagnosticNode, kind); | 355 error(diagnosticNode, kind); |
| 358 } | 356 } |
| 359 } | 357 } |
| 360 return result; | 358 return result; |
| 361 } | 359 } |
| 362 | 360 |
| 363 FunctionElement resolveRedirection(FunctionElement constructor, | 361 FunctionElement resolveRedirection(FunctionElement constructor, |
| (...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 | 1911 |
| 1914 TopScope(LibraryElement library) : super(null, library); | 1912 TopScope(LibraryElement library) : super(null, library); |
| 1915 Element lookup(SourceString name) { | 1913 Element lookup(SourceString name) { |
| 1916 return library.find(name); | 1914 return library.find(name); |
| 1917 } | 1915 } |
| 1918 | 1916 |
| 1919 Element add(Element newElement) { | 1917 Element add(Element newElement) { |
| 1920 throw "Cannot add an element in the top scope"; | 1918 throw "Cannot add an element in the top scope"; |
| 1921 } | 1919 } |
| 1922 } | 1920 } |
| OLD | NEW |