| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library engine.resolver.element_resolver; | 5 library engine.resolver.element_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'error.dart'; | 9 import 'error.dart'; |
| 10 import 'scanner.dart' as sc; | 10 import 'scanner.dart' as sc; |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 return null; | 1054 return null; |
| 1055 } | 1055 } |
| 1056 InterfaceType superType = enclosingClass.supertype; | 1056 InterfaceType superType = enclosingClass.supertype; |
| 1057 if (superType == null) { | 1057 if (superType == null) { |
| 1058 // TODO(brianwilkerson) Report this error. | 1058 // TODO(brianwilkerson) Report this error. |
| 1059 return null; | 1059 return null; |
| 1060 } | 1060 } |
| 1061 SimpleIdentifier name = node.constructorName; | 1061 SimpleIdentifier name = node.constructorName; |
| 1062 String superName = name != null ? name.name : null; | 1062 String superName = name != null ? name.name : null; |
| 1063 ConstructorElement element = superType.lookUpConstructor(superName, _definin
gLibrary); | 1063 ConstructorElement element = superType.lookUpConstructor(superName, _definin
gLibrary); |
| 1064 if (element == null) { | 1064 if (element == null || |
| 1065 !enclosingClass.isSuperConstructorAccessible(element)) { |
| 1065 if (name != null) { | 1066 if (name != null) { |
| 1066 _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_
IN_INITIALIZER, node, [superType.displayName, name]); | 1067 _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_
IN_INITIALIZER, node, [superType.displayName, name]); |
| 1067 } else { | 1068 } else { |
| 1068 _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_
IN_INITIALIZER_DEFAULT, node, [superType.displayName]); | 1069 _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_
IN_INITIALIZER_DEFAULT, node, [superType.displayName]); |
| 1069 } | 1070 } |
| 1070 return null; | 1071 return null; |
| 1071 } else { | 1072 } else { |
| 1072 if (element.isFactory) { | 1073 if (element.isFactory) { |
| 1073 _resolver.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRU
CTOR, node, [element]); | 1074 _resolver.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRU
CTOR, node, [element]); |
| 1074 } | 1075 } |
| (...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2645 @override | 2646 @override |
| 2646 Element get propagatedElement => null; | 2647 Element get propagatedElement => null; |
| 2647 | 2648 |
| 2648 @override | 2649 @override |
| 2649 Element get staticElement => null; | 2650 Element get staticElement => null; |
| 2650 | 2651 |
| 2651 @override | 2652 @override |
| 2652 void visitChildren(AstVisitor visitor) { | 2653 void visitChildren(AstVisitor visitor) { |
| 2653 } | 2654 } |
| 2654 } | 2655 } |
| OLD | NEW |