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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 10837194: Fix for inferred type warnings pref page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index a6f774551e689cd6b1a7018221c7bb35b63ae296..8d0a9d12fbf6c07d61951d8f7a39f43f305321a3 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -182,7 +182,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
private final InterfaceType dynamicIteratorType;
private final boolean developerModeChecks;
private final boolean suppressSdkWarnings;
- private final boolean suppressNoMemberWarningForInferredTypes;
+ private final boolean memberWarningForInferredTypes;
/**
* Keeps track of the number of nested catches, used to detect re-throws
@@ -208,7 +208,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
this.dynamicIteratorType = typeProvider.getIteratorType(dynamicType);
CompilerOptions compilerOptions = context.getCompilerConfiguration().getCompilerOptions();
this.suppressSdkWarnings = compilerOptions.suppressSdkWarnings();
- this.suppressNoMemberWarningForInferredTypes = compilerOptions.suppressNoMemberWarningForInferredTypes();
+ this.memberWarningForInferredTypes = compilerOptions.memberWarningForInferredTypes();
}
@VisibleForTesting
@@ -562,7 +562,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
}
Member member = itype.lookupMember(methodName);
if (member == null) {
- if (!receiver.isInferred() || !suppressNoMemberWarningForInferredTypes) {
+ if (memberWarningForInferredTypes || !receiver.isInferred()) {
typeError(problemTarget, TypeErrorCode.INTERFACE_HAS_NO_METHOD_NAMED, receiver,
methodName);
}
@@ -915,7 +915,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
}
}
default:
- if (!receiver.isInferred() || !suppressNoMemberWarningForInferredTypes) {
+ if (memberWarningForInferredTypes || !receiver.isInferred()) {
typeError(diagnosticNode, TypeErrorCode.NOT_A_METHOD_IN, name, receiver);
}
return dynamicType;
@@ -2003,7 +2003,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
String name = node.getPropertyName();
InterfaceType.Member member = cls.lookupMember(name);
if (member == null) {
- if (!receiver.isInferred() || !suppressNoMemberWarningForInferredTypes) {
+ if (memberWarningForInferredTypes || !receiver.isInferred()) {
typeError(node.getName(), TypeErrorCode.NOT_A_MEMBER_OF, name, cls);
}
return dynamicType;

Powered by Google App Engine
This is Rietveld 408576698