Index: test/comments/generic_methods.unit |
diff --git a/test/comments/generic_methods.unit b/test/comments/generic_methods.unit |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d9d28fa796995900975f4829d76e9af4e91e8c73 |
--- /dev/null |
+++ b/test/comments/generic_methods.unit |
@@ -0,0 +1,53 @@ |
+40 columns | |
+>>> function declaration |
+int f/*<S, T>*/(int x) => 3; |
+<<< |
+int f/*<S, T>*/(int x) => 3; |
+>>> type bounds |
+int f/*<S extends Set<S>>*/(int x) => 3; |
+<<< |
+int f/*<S extends Set<S>>*/(int x) => 3; |
+>>> method |
+class C { |
+ static int f/*<S, T>*/(int x) => 3; |
+ int m/*<S, T>*/(int x) => 3; |
+} |
+<<< |
+class C { |
+ static int f/*<S, T>*/(int x) => 3; |
+ int m/*<S, T>*/(int x) => 3; |
+} |
+>>> function type parameter |
+void foo(int f/*<S>*/(int x)) {} |
+<<< |
+void foo(int f/*<S>*/(int x)) {} |
+>>> variable |
+var x = /*<S>*/(int x) => x; |
+<<< |
+var x = /*<S>*/(int x) => x; |
+>>> parameter type |
+foo/*<S>*/(dynamic/*=S*/ x) => x; |
+<<< |
+foo/*<S>*/(dynamic/*=S*/ x) => x; |
+>>> return type |
+dynamic/*=S*/ foo/*<S>*/() => x; |
+<<< |
+dynamic/*=S*/ foo/*<S>*/() => x; |
+>>> without dynamic |
+main() { |
+ /*=S*/ foo/*<S>*/(/*=S*/ x) {return x;} |
+} |
+<<< |
+main() { |
+ /*=S*/ foo/*<S>*/(/*=S*/ x) { |
+ return x; |
+ } |
+} |
+>>> var |
+void foo/*<S>*/(var /*=S*/ x) { |
+ var /*=S*/ y = x; |
+} |
+<<< |
+void foo/*<S>*/(var/*=S*/ x) { |
+ var/*=S*/ y = x; |
+} |