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

Side by Side Diff: frog/type.dart

Issue 8789008: Fix "extends" checks. Move them out of resolve phase and do them on demand. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « frog/minfrog ('k') | tests/language/language.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
None
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class Type extends Element { 5 class Type extends Element {
6 bool isTested = false; 6 bool isTested = false;
7 bool isChecked = false; 7 bool isChecked = false;
8 8
9 /** 9 /**
10 * For core types (int, String, etc) this is the generated type assertion 10 * For core types (int, String, etc) this is the generated type assertion
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 Map<String, Member> getAllMembers() => {}; 102 Map<String, Member> getAllMembers() => {};
103 103
104 bool _hasNativeSubtypes; 104 bool _hasNativeSubtypes;
105 bool get hasNativeSubtypes() { 105 bool get hasNativeSubtypes() {
106 if (_hasNativeSubtypes == null) { 106 if (_hasNativeSubtypes == null) {
107 _hasNativeSubtypes = subtypes.some((t) => t.isNative); 107 _hasNativeSubtypes = subtypes.some((t) => t.isNative);
108 } 108 }
109 return _hasNativeSubtypes; 109 return _hasNativeSubtypes;
110 } 110 }
111 111
112 void _checkExtends() {
113 var typeParams = genericType.typeParameters;
114 if (typeParams != null && typeArgsInOrder != null) {
115 // TODO(jmesserly): making typeArgsInOrder be a List instead of a
116 // Collection would clean this up.
117 var args = typeArgsInOrder.iterator();
118 var params = typeParams.iterator();
119 while (args.hasNext() && params.hasNext()) {
120 var typeParam = params.next();
121 var typeArg = args.next();
122 if (typeParam.extendsType != null && typeArg != null) {
123 typeArg.ensureSubtypeOf(typeParam.extendsType, typeParam.span, true);
124 }
125 }
126 }
127
128 // Parent should be handled by the super constructor call, but we still
129 // need to check our interfaces.
130 if (interfaces != null) {
131 for (var i in interfaces) {
132 i._checkExtends();
133 }
134 }
135 }
136
112 void _checkOverride(Member member) { 137 void _checkOverride(Member member) {
113 // always look in parents to check that any overloads are legal 138 // always look in parents to check that any overloads are legal
114 var parentMember = _getMemberInParents(member.name); 139 var parentMember = _getMemberInParents(member.name);
115 if (parentMember != null) { 140 if (parentMember != null) {
116 // TODO(jimhug): Ensure that this is only done once. 141 // TODO(jimhug): Ensure that this is only done once.
117 if (!member.isPrivate || member.library == parentMember.library) { 142 if (!member.isPrivate || member.library == parentMember.library) {
118 member.override(parentMember); 143 member.override(parentMember);
119 } 144 }
120 } 145 }
121 } 146 }
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 543
519 /** A concrete version of a generic type. */ 544 /** A concrete version of a generic type. */
520 class ConcreteType extends Type { 545 class ConcreteType extends Type {
521 final DefinedType genericType; 546 final DefinedType genericType;
522 Map<String, Type> typeArguments; 547 Map<String, Type> typeArguments;
523 List<Type> _interfaces; 548 List<Type> _interfaces;
524 Type _parent; 549 Type _parent;
525 Set<Type> _subtypes; 550 Set<Type> _subtypes;
526 List<Type> typeArgsInOrder; 551 List<Type> typeArgsInOrder;
527 552

error: old chunk mismatch

OLDNEW
« no previous file with comments | « frog/minfrog ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698