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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.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
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index f153e21872094a1d5b295f6dffd11987d19edc93..15da593d611dce5bdce0ce9461d0a448fe4e7753 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -3,9 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.type;
-import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
-import static com.google.dart.compiler.common.ErrorExpectation.errEx;
-
import com.google.common.base.Joiner;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@@ -57,6 +54,9 @@ import com.google.dart.compiler.resolver.NodeElement;
import com.google.dart.compiler.resolver.ResolverErrorCode;
import com.google.dart.compiler.resolver.TypeErrorCode;
+import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
+import static com.google.dart.compiler.common.ErrorExpectation.errEx;
+
import java.io.Reader;
import java.io.StringReader;
import java.net.URI;
@@ -3325,37 +3325,6 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
/**
- * It is a static warning if the return type of the user-declared "operator -" is explicitly
- * declared and not a numerical type.
- * <p>
- * http://code.google.com/p/dart/issues/detail?id=3224
- */
- public void test_negateOperatorType() throws Exception {
- AnalyzeLibraryResult libraryResult = analyzeLibrary(
- "// filler filler filler filler filler filler filler filler filler filler",
- "class A {",
- " num operator -() {}",
- "}",
- "class B {",
- " int operator -() {}",
- "}",
- "class C {",
- " double operator -() {}",
- "}",
- "class D {",
- " String operator -() {}",
- "}",
- "class E {",
- " Object operator -() {}",
- "}",
- "");
- assertErrors(
- libraryResult.getErrors(),
- errEx(TypeErrorCode.OPERATOR_NEGATE_NUM_RETURN_TYPE, 12, 3, 6),
- errEx(TypeErrorCode.OPERATOR_NEGATE_NUM_RETURN_TYPE, 15, 3, 6));
- }
-
- /**
* It is a static warning if the return type of the user-declared operator == is explicitly
* declared and not bool.
*/
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698