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

Unified Diff: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java

Issue 10990086: Parse and report error for const parameters (issue 5289) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java (revision 12966)
+++ compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java (working copy)
@@ -505,6 +505,15 @@
parserRunner.getDartUnit().toSource());
}
+ public void test_formalParameters_const() throws Exception {
+ parseExpectErrors(
+ Joiner.on("\n").join(
+ "func_const(const x) {}",
+ "func_constTyped(const int $) {}"),
+ errEx(ParserErrorCode.FORMAL_PARAMETER_IS_CONST, 1, 12, 5),
+ errEx(ParserErrorCode.FORMAL_PARAMETER_IS_CONST, 2, 17, 5));
+ }
+
/**
* Test with variants of function declarations and function literal invocations.
*/
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698