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

Unified Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 1579503005: fix #25409, error if a generic method argument did not have a corresponding parameter (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 9be8bfb7251eae2ccab77b3df9d54386caa9cbf5..a4878c66987c8484c0f28527f06359303373604c 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -1404,7 +1404,32 @@ void main() {
class DerivedFuture4<A> extends Future<A> {
/*=B*/ then/*<B>*/(Object onValue(A a)) => null;
}
- '''
+ '''
+ });
+
+ testChecker('generic function wrong number of arguments', {
+ '/main.dart': r'''
+ /*=T*/ foo/*<T>*/(/*=T*/ x, /*=T*/ y) => x;
+ /*=T*/ bar/*<T>*/({/*=T*/ x, /*=T*/ y}) => x;
+
+ main() {
+ // resolving thses shouldn't crash.
+ foo(1, 2, 3);
+ String x = foo('1', '2', '3');
+ foo(1);
+ String x = foo('1');
+ x = /*severe:STATIC_TYPE_ERROR*/foo(1, 2, 3);
+ x = /*severe:STATIC_TYPE_ERROR*/foo(1);
+
+ // named arguments
+ bar(y: 1, x: 2, z: 3);
+ String x = bar(z: '1', x: '2', y: '3');
+ bar(y: 1);
+ x = bar(x: '1', z: 42);
+ x = /*severe:STATIC_TYPE_ERROR*/bar(y: 1, x: 2, z: 3);
+ x = /*severe:STATIC_TYPE_ERROR*/bar(x: 1);
+ }
+ '''
});
testChecker('unary operators', {
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698