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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java

Issue 49743005: Issue 13449. Bind parameters to arguments and check for function expression invocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
index 87dde658acd309345662b11629c1950b3d363488..6c3017087d1599c3e7542f8bb95a81a379d5f9b7 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
@@ -347,6 +347,17 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_argumentTypeNotAssignable_functionExpressionInvocation_required()
+ throws Exception {
+ Source source = addSource(createSource(//
+ "main() {",
+ " (int x) {} ('');",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
public void test_argumentTypeNotAssignable_index() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -915,6 +926,16 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_extraPositionalArguments_functionExpression() throws Exception {
+ Source source = addSource(createSource(//
+ "main() {",
+ " (int x) {} (0, 1);",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS);
+ verify(source);
+ }
+
public void test_fieldInitializedInInitializerAndDeclaration_final() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -1929,6 +1950,16 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_notEnoughRequiredArguments_functionExpression() throws Exception {
+ Source source = addSource(createSource(//
+ "main() {",
+ " (int x) {} ();",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.NOT_ENOUGH_REQUIRED_ARGUMENTS);
+ verify(source);
+ }
+
public void test_partOfDifferentLibrary() throws Exception {
Source source = addSource(createSource(//
"library lib;",

Powered by Google App Engine
This is Rietveld 408576698