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

Unified Diff: tests/language/generic_local_functions_test.dart

Issue 2128243002: Fixes bug in scoping for generic methods. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/compiler/lib/src/tree/unparser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/generic_local_functions_test.dart
diff --git a/tests/language/generic_local_functions_test.dart b/tests/language/generic_local_functions_test.dart
index 1ec1227085e98b99fbc229aa22bbeae0a11fef27..47496a692d67ae2cc0e9455eff35e360846e15b6 100644
--- a/tests/language/generic_local_functions_test.dart
+++ b/tests/language/generic_local_functions_test.dart
@@ -12,13 +12,13 @@ library generic_local_functions_test;
import "package:expect/expect.dart";
// Declare a generic function parameter.
-String f(int g<X, Y>(Map<X, Y> arg)) => null;
+int f(Y g<X, Y>(Map<X, Y> arg, X x)) => g<int, int>(<int, int>{1: 42}, 1);
main() {
// Declare a generic local function
- int h<X extends Y, Y>(Map<X, Y> arg) => null;
+ Y h<X, Y>(Map<X, Y> m, X x) => m[x];
// Pass a generic local function as an argument.
- f(h);
+ Expect.equals(f(h), 42);
// Pass a function expression as an argument.
- f(<X, Y super X>(Map<X, Y> arg) => 42);
+ Expect.equals(f(<X, Y>(Map<X, Y> m, X x) => m[x]), 42);
}
« no previous file with comments | « pkg/compiler/lib/src/tree/unparser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698