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

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

Issue 10885007: Fix for final local variables whose type has a prefix (issue 4670) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/DartParser.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/parser/SyntaxTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java (revision 11447)
+++ compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java (working copy)
@@ -943,6 +943,20 @@
assertTrue(((DartVariableStatement) statement).getModifiers().isConstant());
}
+ public void test_localVariable_final_prefixedType() {
+ DartUnit unit = parseUnit("finalVar.dart", makeCode(
+ "main() {",
+ " final p.T v = 1;",
+ "}"));
+ assertNotNull(unit);
+ DartNode firstNode = unit.getTopLevelNodes().get(0);
+ assertTrue(firstNode instanceof DartMethodDefinition);
+ DartStatement statement = ((DartMethodDefinition) firstNode).getFunction().getBody().getStatements().get(0);
+ DartVariableStatement variableStatement = (DartVariableStatement) statement;
+ assertTrue(variableStatement.getModifiers().isFinal());
+ assertEquals("v", variableStatement.getVariables().get(0).getVariableName());
+ }
+
public void test_metadata_identifier() {
String code = makeCode(
"// filler filler filler filler filler filler filler filler filler filler",
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698