| 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 79c1276028125ef19c6ccdd8ca701fe82b873aa8..0af9c76276a694d591808b33852c8b7f74c16e7c 100644
|
| --- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| +++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| @@ -17,6 +17,9 @@ import com.google.dart.compiler.DartCompilationError;
|
| import com.google.dart.compiler.DartCompilationPhase;
|
| import com.google.dart.compiler.DartCompilerContext;
|
| import com.google.dart.compiler.ErrorCode;
|
| +import com.google.dart.compiler.ErrorSeverity;
|
| +import com.google.dart.compiler.Source;
|
| +import com.google.dart.compiler.SystemLibraryManager;
|
| import com.google.dart.compiler.ast.ASTVisitor;
|
| import com.google.dart.compiler.ast.DartArrayAccess;
|
| import com.google.dart.compiler.ast.DartArrayLiteral;
|
| @@ -180,7 +183,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
| private final InterfaceType functionType;
|
| private final InterfaceType dynamicIteratorType;
|
| private final boolean developerModeChecks;
|
| -
|
| + private final boolean suppressSdkWarnings;
|
| +
|
| /**
|
| * Keeps track of the number of nested catches, used to detect re-throws
|
| * outside of any catch block.
|
| @@ -202,6 +206,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
| this.nullType = typeProvider.getNullType();
|
| this.functionType = typeProvider.getFunctionType();
|
| this.dynamicIteratorType = typeProvider.getIteratorType(dynamicType);
|
| + this.suppressSdkWarnings = context.getCompilerConfiguration().getCompilerOptions()
|
| + .suppressSdkWarnings();
|
| }
|
|
|
| @VisibleForTesting
|
| @@ -218,8 +224,14 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
| return dynamicType;
|
| }
|
|
|
| - private void onError(HasSourceInfo node, ErrorCode code, Object... arguments) {
|
| - context.onError(new DartCompilationError(node, code, arguments));
|
| + private void onError(HasSourceInfo node, ErrorCode errorCode, Object... arguments) {
|
| + Source source = node.getSourceInfo().getSource();
|
| + if (suppressSdkWarnings && errorCode.getErrorSeverity() == ErrorSeverity.WARNING) {
|
| + if (source != null && SystemLibraryManager.isDartUri(source.getUri())) {
|
| + return;
|
| + }
|
| + }
|
| + context.onError(new DartCompilationError(node, errorCode, arguments));
|
| }
|
|
|
| AssertionError internalError(HasSourceInfo node, String message, Object... arguments) {
|
|
|