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

Side by Side Diff: pkg/compiler/lib/src/resolution/class_hierarchy.dart

Issue 1525603002: Associate compile-time errors with elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@_temporary_fletch_patches
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.resolution.class_hierarchy; 5 library dart2js.resolution.class_hierarchy;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show 8 import '../common/resolution.dart' show
9 Feature; 9 Feature;
10 import '../compiler.dart' show 10 import '../compiler.dart' show
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 reporter.reportErrorMessage(node, kind, arguments); 212 reporter.reportErrorMessage(node, kind, arguments);
213 superMember = new ErroneousElementX( 213 superMember = new ErroneousElementX(
214 kind, arguments, '', element); 214 kind, arguments, '', element);
215 registry.registerFeature(Feature.THROW_NO_SUCH_METHOD); 215 registry.registerFeature(Feature.THROW_NO_SUCH_METHOD);
216 } else { 216 } else {
217 ConstructorElement superConstructor = superMember; 217 ConstructorElement superConstructor = superMember;
218 superConstructor.computeType(resolution); 218 superConstructor.computeType(resolution);
219 if (!CallStructure.NO_ARGS.signatureApplies( 219 if (!CallStructure.NO_ARGS.signatureApplies(
220 superConstructor.functionSignature)) { 220 superConstructor.functionSignature)) {
221 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT; 221 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT;
222 reporter.reportErrorMessage(node, kind); 222 DiagnosticMessage message = reporter.createMessage(node, kind);
223 reporter.reportError(message);
Johnni Winther 2015/12/14 11:31:20 This change doesn't seem to be needed.
sigurdm 2015/12/14 12:07:43 Done.
223 superMember = new ErroneousElementX(kind, {}, '', element); 224 superMember = new ErroneousElementX(kind, {}, '', element);
224 } 225 }
225 } 226 }
226 FunctionElement constructor = 227 FunctionElement constructor =
227 new SynthesizedConstructorElementX.forDefault(superMember, element); 228 new SynthesizedConstructorElementX.forDefault(superMember, element);
228 if (superMember.isMalformed) { 229 if (superMember.isMalformed) {
229 compiler.elementsWithCompileTimeErrors.add(constructor); 230 ErroneousElement erroneousElement = superMember;
231 compiler.elementsWithCompileTimeErrors[constructor] =
232 reporter.createMessage(node,
233 erroneousElement.messageKind,
234 erroneousElement.messageArguments);
230 } 235 }
231 element.setDefaultConstructor(constructor, reporter); 236 element.setDefaultConstructor(constructor, reporter);
232 } 237 }
233 return element.computeType(resolution); 238 return element.computeType(resolution);
234 } 239 }
235 240
236 @override 241 @override
237 DartType visitEnum(Enum node) { 242 DartType visitEnum(Enum node) {
238 if (element == null) { 243 if (element == null) {
239 throw reporter.internalError(node, 'element is null'); 244 throw reporter.internalError(node, 'element is null');
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 if (e == null || !e.impliesType) { 723 if (e == null || !e.impliesType) {
719 reporter.reportErrorMessage( 724 reporter.reportErrorMessage(
720 node.selector, 725 node.selector,
721 MessageKind.CANNOT_RESOLVE_TYPE, 726 MessageKind.CANNOT_RESOLVE_TYPE,
722 {'typeName': node.selector}); 727 {'typeName': node.selector});
723 return; 728 return;
724 } 729 }
725 loadSupertype(e, node); 730 loadSupertype(e, node);
726 } 731 }
727 } 732 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698