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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java

Issue 25605002: 'const' instance creation with incompatible argument types is statis warning. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
index f7f1cd5614efcae7941612aa33e5e88a8a8d0edc..5c368e51280dd16e6864e0b36cba794e7bad0f97 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
@@ -1730,20 +1730,12 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
* @param argument the argument to evaluate
* @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
- * @see CompileTimeErrorCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
*/
private boolean checkForArgumentTypeNotAssignable(Expression argument) {
if (argument == null) {
return false;
}
- ErrorCode errorCode;
- if (isInConstInstanceCreation || isEnclosingConstructorConst) {
- errorCode = CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE;
- } else {
- errorCode = StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE;
- }
-
ParameterElement staticParameterElement = argument.getStaticParameterElement();
Type staticParameterType = staticParameterElement == null ? null
: staticParameterElement.getType();
@@ -1756,7 +1748,7 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
argument,
staticParameterType,
propagatedParameterType,
- errorCode);
+ StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
}
/**
@@ -1767,7 +1759,6 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
* @param expectedPropagatedType the expected propagated type, may be {@code null}
* @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
- * @see CompileTimeErrorCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
*/
private boolean checkForArgumentTypeNotAssignable(Expression expression, Type expectedStaticType,
Type expectedPropagatedType, ErrorCode errorCode) {
@@ -1791,7 +1782,6 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
* @param actualPropagatedType the expected propagated type of the parameter, may be {@code null}
* @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
- * @see CompileTimeErrorCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
*/
private boolean checkForArgumentTypeNotAssignable(Expression expression, Type expectedStaticType,
Type actualStaticType, Type expectedPropagatedType, Type actualPropagatedType,
@@ -3251,20 +3241,12 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
* @param argument the expression to which the operator is being applied
* @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
- * @see CompileTimeErrorCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
*/
private boolean checkForIntNotAssignable(Expression argument) {
if (argument == null) {
return false;
}
- ErrorCode errorCode;
- if (isInConstInstanceCreation || isEnclosingConstructorConst) {
- errorCode = CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE;
- } else {
- errorCode = StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE;
- }
-
ParameterElement staticParameterElement = argument.getStaticParameterElement();
Type staticParameterType = staticParameterElement == null ? null
: staticParameterElement.getType();
@@ -3279,7 +3261,7 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
typeProvider.getIntType(),
propagatedParameterType,
typeProvider.getIntType(),
- errorCode);
+ StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
}
/**

Powered by Google App Engine
This is Rietveld 408576698