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

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

Issue 11365011: Better warning to function-like call of getter; Quick Fix for it (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 db91773e2152a85ab95815e2ba5aa67430f26f3b..601edbbfd6cf291b0ad76e470de090312ebd6e10 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -4147,6 +4147,21 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.NOT_A_FUNCTION_TYPE, 10, 3, 3),
errEx(TypeErrorCode.NOT_A_FUNCTION_TYPE, 11, 3, 9));
}
+
+ public void test_invokeNonFunction_getter() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " int get foo => 0;",
+ "}",
+ "main() {",
+ " A a = new A();",
+ " a.foo();",
+ "}");
+ assertErrors(
+ libraryResult.getErrors(),
+ errEx(TypeErrorCode.NOT_A_FUNCTION_TYPE_FIELD, 7, 5, 3));
+ }
public void test_wrongOperandTypeForUnaryExpression() throws Exception {
AnalyzeLibraryResult libraryResult = analyzeLibrary(

Powered by Google App Engine
This is Rietveld 408576698