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

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

Issue 2998573002: Add type inference for invalid constructor initializers. (Closed)
Patch Set: Created 3 years, 4 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 'package:kernel/ast.dart' 7 import 'package:kernel/ast.dart'
8 hide InvalidExpression, InvalidInitializer, InvalidStatement; 8 hide InvalidExpression, InvalidInitializer, InvalidStatement;
9 9
10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; 10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy;
(...skipping 3119 matching lines...) Expand 10 before | Expand all | Expand 10 after
3130 Statement deprecated_buildCompileTimeErrorStatement(error, 3130 Statement deprecated_buildCompileTimeErrorStatement(error,
3131 [int charOffset = -1]) { 3131 [int charOffset = -1]) {
3132 return new KernelExpressionStatement( 3132 return new KernelExpressionStatement(
3133 deprecated_buildCompileTimeError(error, charOffset)); 3133 deprecated_buildCompileTimeError(error, charOffset));
3134 } 3134 }
3135 3135
3136 @override 3136 @override
3137 Initializer buildInvalidInitializer(Expression expression, 3137 Initializer buildInvalidInitializer(Expression expression,
3138 [int charOffset = -1]) { 3138 [int charOffset = -1]) {
3139 needsImplicitSuperInitializer = false; 3139 needsImplicitSuperInitializer = false;
3140 return new LocalInitializer(new VariableDeclaration.forValue(expression)) 3140 return new KernelInvalidInitializer(
3141 new VariableDeclaration.forValue(expression))
3141 ..fileOffset = charOffset; 3142 ..fileOffset = charOffset;
3142 } 3143 }
3143 3144
3144 Initializer buildDuplicatedInitializer( 3145 Initializer buildDuplicatedInitializer(
3145 String name, int offset, int previousInitializerOffset) { 3146 String name, int offset, int previousInitializerOffset) {
3146 Initializer initializer = buildInvalidInitializer( 3147 Initializer initializer = buildInvalidInitializer(
3147 deprecated_buildCompileTimeError( 3148 deprecated_buildCompileTimeError(
3148 "'$name' has already been initialized.", offset), 3149 "'$name' has already been initialized.", offset),
3149 offset); 3150 offset);
3150 deprecated_addCompileTimeError( 3151 deprecated_addCompileTimeError(
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
3801 return AsyncMarker.Async; 3802 return AsyncMarker.Async;
3802 } else { 3803 } else {
3803 assert(identical(starToken.stringValue, "*")); 3804 assert(identical(starToken.stringValue, "*"));
3804 return AsyncMarker.AsyncStar; 3805 return AsyncMarker.AsyncStar;
3805 } 3806 }
3806 } else { 3807 } else {
3807 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens", 3808 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens",
3808 asyncToken.charOffset, null); 3809 asyncToken.charOffset, null);
3809 } 3810 }
3810 } 3811 }
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