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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2829683008: Use a non-null TypeInferrer even in non-strong mode. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 fasta.body_builder; 5 library fasta.body_builder;
6 6
7 import '../fasta_codes.dart' 7 import '../fasta_codes.dart'
8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; 8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody;
9 9
10 import '../parser/parser.dart' show FormalParameterType, optional; 10 import '../parser/parser.dart' show FormalParameterType, optional;
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 @override 440 @override
441 void endInitializers(int count, Token beginToken, Token endToken) { 441 void endInitializers(int count, Token beginToken, Token endToken) {
442 debugEvent("Initializers"); 442 debugEvent("Initializers");
443 } 443 }
444 444
445 @override 445 @override
446 void finishFunction( 446 void finishFunction(
447 FormalParameters formals, AsyncMarker asyncModifier, Statement body) { 447 FormalParameters formals, AsyncMarker asyncModifier, Statement body) {
448 debugEvent("finishFunction"); 448 debugEvent("finishFunction");
449 _typeInferrer?.inferBody(body, uri); 449 _typeInferrer.inferBody(body, uri);
450 KernelFunctionBuilder builder = member; 450 KernelFunctionBuilder builder = member;
451 builder.body = body; 451 builder.body = body;
452 if (formals?.optional != null) { 452 if (formals?.optional != null) {
453 Iterator<FormalParameterBuilder> formalBuilders = 453 Iterator<FormalParameterBuilder> formalBuilders =
454 builder.formals.skip(formals.required.length).iterator; 454 builder.formals.skip(formals.required.length).iterator;
455 for (VariableDeclaration parameter in formals.optional.formals) { 455 for (VariableDeclaration parameter in formals.optional.formals) {
456 bool hasMore = formalBuilders.moveNext(); 456 bool hasMore = formalBuilders.moveNext();
457 assert(hasMore); 457 assert(hasMore);
458 VariableDeclaration realParameter = formalBuilders.current.target; 458 VariableDeclaration realParameter = formalBuilders.current.target;
459 Expression initializer = parameter.initializer ?? new NullLiteral(); 459 Expression initializer = parameter.initializer ?? new NullLiteral();
(...skipping 2614 matching lines...) Expand 10 before | Expand all | Expand 10 after
3074 } else if (node is PrefixBuilder) { 3074 } else if (node is PrefixBuilder) {
3075 return node.name; 3075 return node.name;
3076 } else if (node is ThisAccessor) { 3076 } else if (node is ThisAccessor) {
3077 return node.isSuper ? "super" : "this"; 3077 return node.isSuper ? "super" : "this";
3078 } else if (node is FastaAccessor) { 3078 } else if (node is FastaAccessor) {
3079 return node.plainNameForRead; 3079 return node.plainNameForRead;
3080 } else { 3080 } else {
3081 return internalError("Unhandled: ${node.runtimeType}"); 3081 return internalError("Unhandled: ${node.runtimeType}");
3082 } 3082 }
3083 } 3083 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698