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

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

Issue 11095003: Issue 5719. There are no warning for operator-() and numberic return anymore. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 1528a11f6b0109fdba4b29e68d201d4eaba47418..28ebdb486e6366ebd4334f13acbc513117972c64 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -2046,14 +2046,6 @@ public class TypeAnalyzer implements DartCompilationPhase {
}
}
- // operator "negate" should return numeric type
- if (modifiers.isOperator() && methodElement.getName().equals("-")
- && methodElement.getParameters().isEmpty() && returnTypeNode != null) {
- Type returnType = node.getElement().getFunctionType().getReturnType();
- if (!types.isSubtype(returnType, numType)) {
- typeError(returnTypeNode, TypeErrorCode.OPERATOR_NEGATE_NUM_RETURN_TYPE);
- }
- }
// operator "[]=" should return void
if (modifiers.isOperator() && methodElement.getName().equals("[]=")
&& returnTypeNode != null) {

Powered by Google App Engine
This is Rietveld 408576698