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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 17076002: Type check initializer lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type inference. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index 79ac960985f899fb366aeeb836c276506fc7c149..91f3f44adf75758442bf29c325bdd8086ecfaed5 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -968,6 +968,14 @@ class FieldParameterElementX extends VariableElementX
VariableListElement variables,
Node node)
: super(name, variables, ElementKind.FIELD_PARAMETER, node);
+
+ DartType computeType(Compiler compiler) {
+ VariableDefinitions definitions = variables.parseNode(compiler);
+ if (definitions.type == null && !definitions.modifiers.isVar()) {
ngeoffray 2013/07/12 09:34:03 Maybe add a comment on where in the spec this is?
+ return fieldElement.computeType(compiler);
+ }
+ return super.computeType(compiler);
+ }
}
// This element represents a list of variable or field declaration.

Powered by Google App Engine
This is Rietveld 408576698