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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java

Issue 10627020: Fix for issue 2437 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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/type/TypeAnalyzer.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/resolver/ResolverTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java (revision 9032)
+++ compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java (working copy)
@@ -1065,6 +1065,31 @@
ResolverErrorCode.NO_SUCH_TYPE);
}
+ public void test_typedefUsedAsExpression() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "typedef f();",
+ "main() {",
+ " try {",
+ " 0.25 - f;",
+ " } catch(var e) {}",
+ "}"),
+ ResolverErrorCode.CANNOT_USE_TYPE);
+ }
+
+ public void test_typeVariableUsedAsExpression() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "class A<B> {",
+ " f() {",
+ " try {",
+ " 0.25 - B;",
+ " } catch(var e) {}",
+ " }",
+ "}"),
+ ResolverErrorCode.TYPE_VARIABLE_NOT_ALLOWED_IN_IDENTIFIER);
+ }
+
public void test_shadowType_withVariable() throws Exception {
resolveAndTest(Joiner.on("\n").join(
"class Object {}",
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698