| 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 cb8a83a399bc86e5cca0af96ddbdcc243dc9d10b..961a981ee6f01a012049a91c7c0f631021526936 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| @@ -5307,11 +5307,28 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
|
|
| /**
|
| * Developers unfamiliar with Dart frequently write (x/y).toInt() instead of x ~/ y. The editor
|
| - * should recognize that pattern
|
| + * should recognize that pattern.
|
| * <p>
|
| * http://code.google.com/p/dart/issues/detail?id=5652
|
| */
|
| - public void test_useEffectiveIntegerDivision() throws Exception {
|
| + public void test_useEffectiveIntegerDivision_int() throws Exception {
|
| + AnalyzeLibraryResult result = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "main() {",
|
| + " int x = 7;",
|
| + " int y = 2;",
|
| + " print( (x / y).toInt() );",
|
| + "}",
|
| + "");
|
| + assertErrors(result.getErrors(), errEx(TypeErrorCode.USE_INTEGER_DIVISION, 5, 10, 15));
|
| + }
|
| +
|
| + /**
|
| + * We need to report warning only when arguments are integers.
|
| + * <p>
|
| + * http://code.google.com/p/dart/issues/detail?id=5652
|
| + */
|
| + public void test_useEffectiveIntegerDivision_num() throws Exception {
|
| AnalyzeLibraryResult result = analyzeLibrary(
|
| "// filler filler filler filler filler filler filler filler filler filler",
|
| "main() {",
|
| @@ -5320,6 +5337,6 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| " print( (x / y).toInt() );",
|
| "}",
|
| "");
|
| - assertErrors(result.getErrors(), errEx(TypeErrorCode.USE_INTEGER_DIVISION, 5, 10, 15));
|
| + assertErrors(result.getErrors());
|
| }
|
| }
|
|
|