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

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

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add TODOs. Created 5 years, 2 months 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) 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 dart2js.resolution.signatures; 5 library dart2js.resolution.signatures;
6 6
7 import '../compiler.dart' show 7 import '../compiler.dart' show
8 Compiler; 8 Compiler;
9 import '../dart_types.dart'; 9 import '../dart_types.dart';
10 import '../diagnostics/invariant.dart' show 10 import '../diagnostics/invariant.dart' show
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } else if (link.head.asSend() != null && 141 } else if (link.head.asSend() != null &&
142 link.head.asSend().selector.asFunctionExpression() != null) { 142 link.head.asSend().selector.asFunctionExpression() != null) {
143 // Inline function typed initializing formal or 143 // Inline function typed initializing formal or
144 // parameter with default value, like `C(int this.f(String s))` or 144 // parameter with default value, like `C(int this.f(String s))` or
145 // `void m([int f(String s) = null])`. 145 // `void m([int f(String s) = null])`.
146 computeFunctionType(link.head.asSend().selector.asFunctionExpression()); 146 computeFunctionType(link.head.asSend().selector.asFunctionExpression());
147 } else { 147 } else {
148 assert(invariant(currentDefinitions, 148 assert(invariant(currentDefinitions,
149 link.head.asIdentifier() != null || link.head.asSend() != null)); 149 link.head.asIdentifier() != null || link.head.asSend() != null));
150 if (fieldElement != null) { 150 if (fieldElement != null) {
151 element.typeCache = fieldElement.computeType(compiler); 151 element.typeCache = fieldElement.computeType(resolution);
152 } else { 152 } else {
153 element.typeCache = const DynamicType(); 153 element.typeCache = const DynamicType();
154 } 154 }
155 } 155 }
156 } 156 }
157 } 157 }
158 158
159 FormalElementX visitIdentifier(Identifier node) { 159 FormalElementX visitIdentifier(Identifier node) {
160 return createParameter(node, null); 160 return createParameter(node, null);
161 } 161 }
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 DartType resolveReturnType(TypeAnnotation annotation) { 441 DartType resolveReturnType(TypeAnnotation annotation) {
442 if (annotation == null) return const DynamicType(); 442 if (annotation == null) return const DynamicType();
443 DartType result = resolver.resolveTypeAnnotation(annotation); 443 DartType result = resolver.resolveTypeAnnotation(annotation);
444 if (result == null) { 444 if (result == null) {
445 return const DynamicType(); 445 return const DynamicType();
446 } 446 }
447 return result; 447 return result;
448 } 448 }
449 } 449 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution_common.dart ('k') | pkg/compiler/lib/src/resolution/type_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698