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

Side by Side Diff: pkg/analyzer/lib/src/generated/element_resolver.dart

Issue 724133003: Improve error reporting when a mixin application is invalid. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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) 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 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (!enclosingClass.mixinErrorsReported &&
1066 !enclosingClass.isSuperConstructorAccessible(element))) {
1066 if (name != null) { 1067 if (name != null) {
1067 _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_ IN_INITIALIZER, node, [superType.displayName, name]); 1068 _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_ IN_INITIALIZER, node, [superType.displayName, name]);
1068 } else { 1069 } else {
1069 _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_ IN_INITIALIZER_DEFAULT, node, [superType.displayName]); 1070 _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_ IN_INITIALIZER_DEFAULT, node, [superType.displayName]);
1070 } 1071 }
1071 return null; 1072 return null;
1072 } else { 1073 } else {
1073 if (element.isFactory) { 1074 if (element.isFactory) {
1074 _resolver.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRU CTOR, node, [element]); 1075 _resolver.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRU CTOR, node, [element]);
1075 } 1076 }
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2646 @override 2647 @override
2647 Element get propagatedElement => null; 2648 Element get propagatedElement => null;
2648 2649
2649 @override 2650 @override
2650 Element get staticElement => null; 2651 Element get staticElement => null;
2651 2652
2652 @override 2653 @override
2653 void visitChildren(AstVisitor visitor) { 2654 void visitChildren(AstVisitor visitor) {
2654 } 2655 }
2655 } 2656 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698