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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.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/types/simple_types_inferrer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
index 2473f801d4d1b72d9b5276d1c4a616723d7b840f..317e0b6f4bfaf43c482adb9c356fc47c1a644d5a 100644
--- a/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
@@ -82,7 +82,7 @@ abstract class TypeInformation {
void addCaller(Element element) {
callers.add(element);
}
-
+
void addAssignment(Node node, TypeMask mask) {
assignments[node] = mask;
}
@@ -428,7 +428,7 @@ class InternalSimpleTypesInferrer extends TypesInferrer {
if (hasAnalyzedAll) return;
if (analyzed < numberOfElementsToAnalyze) return;
hasAnalyzedAll = true;
-
+
// If we have analyzed all the world, we know all assigments to
// fields and parameters, and can therefore infer a type for them.
typeInfo.forEach((element, TypeInformation info) {
@@ -662,7 +662,9 @@ class InternalSimpleTypesInferrer extends TypesInferrer {
if (compiler.trustTypeAnnotations
// Parameters are being checked by the method, and we can
// therefore only trust their type after the checks.
- || (compiler.enableTypeAssertions && !analyzedElement.isParameter())) {
+ || (compiler.enableTypeAssertions &&
+ !analyzedElement.isParameter() &&
+ !analyzedElement.isFieldParameter())) {
ngeoffray 2013/07/12 09:34:03 Do we have a test for this? How did you find it wa
var annotation = analyzedElement.computeType(compiler);
if (analyzedElement.isGetter()
|| analyzedElement.isFunction()

Powered by Google App Engine
This is Rietveld 408576698