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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 9186015: Issue 933: Fix for resolving type of Function in field. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rollback TypeTestCase change Created 8 years, 11 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: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 64ef5cb6e63f4057b7a2af29d18636a2512a2478..bb398ab45d1be39f9fbf33f97ac186939cda3b31 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -426,8 +426,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
* Factory constructor can instantiate any class and return it non-abstract class instance, but
* spec requires warnings, so we provide it, but using different constant.
*/
- public void testWarnOnNonVoidSetter()
- throws Exception {
+ public void testWarnOnNonVoidSetter() throws Exception {
AnalyzeLibraryResult libraryResult =
analyzeLibrary(
getName(),
@@ -443,4 +442,23 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.SETTER_RETURN_TYPE, 4, 3, 7),
errEx(TypeErrorCode.SETTER_RETURN_TYPE, 5, 3, 4));
}
+
+ /**
+ * We should be able to call <code>Function</code> even if it is in the field.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=933
+ */
+ public void test_callFunctionFromField() throws Exception {
+ AnalyzeLibraryResult libraryResult =
+ analyzeLibrary(
+ getName(),
+ makeCode(
+ "class WorkElement {",
+ " Function run;",
+ "}",
+ "foo(WorkElement e) {",
+ " e.run();",
+ "}"));
+ assertErrors(libraryResult.getTypeErrors());
+ }
}

Powered by Google App Engine
This is Rietveld 408576698