| Index: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
|
| index b04a4f277380f2fc59dbd4e2bd0089ff50181f61..28801df0f94b703cf43be2422658cc2131fc793e 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
|
| @@ -5,6 +5,7 @@ package com.google.dart.compiler.parser;
|
|
|
| import com.google.common.base.Joiner;
|
| import com.google.dart.compiler.CompilerTestCase;
|
| +import com.google.dart.compiler.ast.DartClass;
|
| import com.google.dart.compiler.ast.DartIdentifier;
|
| import com.google.dart.compiler.ast.DartMethodDefinition;
|
| import com.google.dart.compiler.ast.DartNode;
|
| @@ -698,6 +699,21 @@ public class NegativeParserTest extends CompilerTestCase {
|
| "}",
|
| ""));
|
| }
|
| +
|
| + /**
|
| + * We can parse operator "equals" declaration.
|
| + */
|
| + public void test_operator_equals() {
|
| + DartParserRunner runner = parseExpectErrors(Joiner.on("\n").join(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {",
|
| + " operator equals(other) => false;",
|
| + "}",
|
| + ""));
|
| + DartClass clazz = (DartClass) runner.getDartUnit().getTopLevelNodes().get(0);
|
| + DartMethodDefinition method = (DartMethodDefinition) clazz.getMembers().get(0);
|
| + assertTrue(method.getModifiers().isOperator());
|
| + }
|
|
|
| /**
|
| * "native" can be specified only for classes.
|
|
|