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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java

Issue 9016050: Flag methods as not being valid compile time constants (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Methods are not acceptable compile time constants Created 8 years, 12 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 | « no previous file | compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
index 352be8eebd1639e05a1a81cb3632e39062b79c3c..d84849e7ceed2cc87f3de9c2a7bc3a264ec723f3 100644
--- a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
@@ -320,6 +320,10 @@ public class CompileTimeConstantAnalyzer {
rememberInferredType(x, type);
break;
+ case METHOD:
+ expectedConstant(x);
+ return null;
+
default:
throw new InternalCompilerException("Unexpected element "
+ x.toString() + " kind: " + ElementKind.of(element)
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698