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

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

Issue 2567943003: Remove support for mixin typedefs in dart2js. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « pkg/compiler/lib/src/parser/parser.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Resolution; 8 import '../common/resolution.dart' show Resolution;
9 import '../core_types.dart' show CoreClasses, CoreTypes; 9 import '../core_types.dart' show CoreClasses, CoreTypes;
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 DartType visitNamedMixinApplication(NamedMixinApplication node) { 270 DartType visitNamedMixinApplication(NamedMixinApplication node) {
271 if (element == null) { 271 if (element == null) {
272 throw reporter.internalError(node, 'element is null'); 272 throw reporter.internalError(node, 'element is null');
273 } 273 }
274 if (element.resolutionState != STATE_STARTED) { 274 if (element.resolutionState != STATE_STARTED) {
275 throw reporter.internalError( 275 throw reporter.internalError(
276 element, 'cyclic resolution of class $element'); 276 element, 'cyclic resolution of class $element');
277 } 277 }
278 278
279 if (identical(node.classKeyword.stringValue, 'typedef')) {
280 // TODO(aprelev@gmail.com): Remove this deprecation diagnostic
281 // together with corresponding TODO in parser.dart.
282 reporter.reportWarningMessage(
283 node.classKeyword, MessageKind.DEPRECATED_TYPEDEF_MIXIN_SYNTAX);
284 }
285
286 element.computeType(resolution); 279 element.computeType(resolution);
287 scope = new TypeDeclarationScope(scope, element); 280 scope = new TypeDeclarationScope(scope, element);
288 resolveTypeVariableBounds(node.typeParameters); 281 resolveTypeVariableBounds(node.typeParameters);
289 282
290 // Generate anonymous mixin application elements for the 283 // Generate anonymous mixin application elements for the
291 // intermediate mixin applications (excluding the last). 284 // intermediate mixin applications (excluding the last).
292 DartType supertype = resolveSupertype(element, node.superclass); 285 DartType supertype = resolveSupertype(element, node.superclass);
293 Link<Node> link = node.mixins.nodes; 286 Link<Node> link = node.mixins.nodes;
294 while (!link.tail.isEmpty) { 287 while (!link.tail.isEmpty) {
295 supertype = applyMixin(supertype, checkMixinType(link.head), link.head); 288 supertype = applyMixin(supertype, checkMixinType(link.head), link.head);
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 Identifier selector = node.selector.asIdentifier(); 638 Identifier selector = node.selector.asIdentifier();
646 var e = prefixElement.lookupLocalMember(selector.source); 639 var e = prefixElement.lookupLocalMember(selector.source);
647 if (e == null || !e.impliesType) { 640 if (e == null || !e.impliesType) {
648 reporter.reportErrorMessage(node.selector, 641 reporter.reportErrorMessage(node.selector,
649 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); 642 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector});
650 return; 643 return;
651 } 644 }
652 loadSupertype(e, node); 645 loadSupertype(e, node);
653 } 646 }
654 } 647 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/parser/parser.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698