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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java

Issue 427603002: Properly handle "#void" in analysis server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java
index 3959853d6b6e636513ab48a7c5bc21a1a7ccfee6..c8dd4ad191b8fd4cb1d563bb3d65fb8012c36114 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java
@@ -752,6 +752,16 @@ public class ConstantValueComputerTest extends ResolverTestCase {
assertFalse(ConstantValueComputer.isValidPublicSymbol("foo.void"));
}
+ public void test_symbolLiteral_void() throws Exception {
+ CompilationUnit compilationUnit = resolveSource(createSource(//
+ "const voidSymbol = #void;"));
+ VariableDeclaration voidSymbol = findTopLevelDeclaration(compilationUnit, "voidSymbol");
+ EvaluationResultImpl voidSymbolResult = ((VariableElementImpl) voidSymbol.getElement()).getEvaluationResult();
+ DartObjectImpl value = ((ValidResult) voidSymbolResult).getValue();
+ assertEquals(getTypeProvider().getSymbolType(), value.getType());
+ assertEquals("void", value.getValue());
+ }
+
private HashMap<String, DartObjectImpl> assertFieldType(HashMap<String, DartObjectImpl> fields,
String fieldName, String expectedType) {
DartObjectImpl field = fields.get(fieldName);

Powered by Google App Engine
This is Rietveld 408576698