| 1 |
This test checks the quick fix for undefined functions. |
| 2 |
|
| 3 |
-- channels.go -- |
| 4 |
package missingfunction |
| 5 |
|
| 6 |
func channels(s string) { |
| 7 |
undefinedChannels(c()) //@quickfix("undefinedChannels", re"(undeclared|undefined)", channels) |
| 8 |
} |
| 9 |
|
| 10 |
func c() (<-chan string, chan string) { |
| 11 |
return make(<-chan string), make(chan string) |
| 12 |
} |
| 13 |
-- @channels/channels.go -- |
| 14 |
@@ -7 +7,4 @@ |
| 15 |
+func undefinedChannels(ch1 <-chan string, ch2 chan string) { |
| 16 |
+ panic("unimplemented") |
| 17 |
+} |
| 18 |
+ |
| 19 |
-- consecutive.go -- |
| 20 |
package missingfunction |
| 21 |
|
| 22 |
func consecutiveParams() { |
| 23 |
var s string |
| 24 |
undefinedConsecutiveParams(s, s) //@quickfix("undefinedConsecutiveParams", re"(undeclared|undefined)", consecutive) |
| 25 |
} |
| 26 |
-- @consecutive/consecutive.go -- |
| 27 |
@@ -7 +7,4 @@ |
| 28 |
+ |
| 29 |
+func undefinedConsecutiveParams(s1, s2 string) { |
| 30 |
+ panic("unimplemented") |
| 31 |
+} |
| 32 |
-- error.go -- |
| 33 |
package missingfunction |
| 34 |
|
| 35 |
func errorParam() { |
| 36 |
var err error |
| 37 |
undefinedErrorParam(err) //@quickfix("undefinedErrorParam", re"(undeclared|undefined)", error) |
| 38 |
} |
| 39 |
-- @error/error.go -- |
| 40 |
@@ -7 +7,4 @@ |
| 41 |
+ |
| 42 |
+func undefinedErrorParam(err error) { |
| 43 |
+ panic("unimplemented") |
| 44 |
+} |
| 45 |
-- literals.go -- |
| 46 |
package missingfunction |
| 47 |
|
| 48 |
type T struct{} |
| 49 |
|
| 50 |
func literals() { |
| 51 |
undefinedLiterals("hey compiler", T{}, &T{}) //@quickfix("undefinedLiterals", re"(undeclared|undefined)", literals) |
| 52 |
} |
| 53 |
-- @literals/literals.go -- |
| 54 |
@@ -8 +8,4 @@ |
| 55 |
+ |
| 56 |
+func undefinedLiterals(s string, t1 T, t2 *T) { |
| 57 |
+ panic("unimplemented") |
| 58 |
+} |
| 59 |
-- operation.go -- |
| 60 |
package missingfunction |
| 61 |
|
| 62 |
import "time" |
| 63 |
|
| 64 |
func operation() { |
| 65 |
undefinedOperation(10 * time.Second) //@quickfix("undefinedOperation", re"(undeclared|undefined)", operation) |
| 66 |
} |
| 67 |
-- @operation/operation.go -- |
| 68 |
@@ -8 +8,4 @@ |
| 69 |
+ |
| 70 |
+func undefinedOperation(duration time.Duration) { |
| 71 |
+ panic("unimplemented") |
| 72 |
+} |
| 73 |
-- selector.go -- |
| 74 |
package missingfunction |
| 75 |
|
| 76 |
func selector() { |
| 77 |
m := map[int]bool{} |
| 78 |
undefinedSelector(m[1]) //@quickfix("undefinedSelector", re"(undeclared|undefined)", selector) |
| 79 |
} |
| 80 |
-- @selector/selector.go -- |
| 81 |
@@ -7 +7,4 @@ |
| 82 |
+ |
| 83 |
+func undefinedSelector(b bool) { |
| 84 |
+ panic("unimplemented") |
| 85 |
+} |
| 86 |
-- slice.go -- |
| 87 |
package missingfunction |
| 88 |
|
| 89 |
func slice() { |
| 90 |
undefinedSlice([]int{1, 2}) //@quickfix("undefinedSlice", re"(undeclared|undefined)", slice) |
| 91 |
} |
| 92 |
-- @slice/slice.go -- |
| 93 |
@@ -6 +6,4 @@ |
| 94 |
+ |
| 95 |
+func undefinedSlice(i []int) { |
| 96 |
+ panic("unimplemented") |
| 97 |
+} |
| 98 |
-- tuple.go -- |
| 99 |
package missingfunction |
| 100 |
|
| 101 |
func tuple() { |
| 102 |
undefinedTuple(b()) //@quickfix("undefinedTuple", re"(undeclared|undefined)", tuple) |
| 103 |
} |
| 104 |
|
| 105 |
func b() (string, error) { |
| 106 |
return "", nil |
| 107 |
} |
| 108 |
-- @tuple/tuple.go -- |
| 109 |
@@ -7 +7,4 @@ |
| 110 |
+func undefinedTuple(s string, err error) { |
| 111 |
+ panic("unimplemented") |
| 112 |
+} |
| 113 |
+ |
| 114 |
-- unique_params.go -- |
| 115 |
package missingfunction |
| 116 |
|
| 117 |
func uniqueArguments() { |
| 118 |
var s string |
| 119 |
var i int |
| 120 |
undefinedUniqueArguments(s, i, s) //@quickfix("undefinedUniqueArguments", re"(undeclared|undefined)", unique) |
| 121 |
} |
| 122 |
-- @unique/unique_params.go -- |
| 123 |
@@ -8 +8,4 @@ |
| 124 |
+ |
| 125 |
+func undefinedUniqueArguments(s1 string, i int, s2 string) { |
| 126 |
+ panic("unimplemented") |
| 127 |
+} |
| 128 |
-- param.go -- |
| 129 |
package missingfunction |
| 130 |
|
| 131 |
func inferFromParam() { |
| 132 |
f(as_param()) //@quickfix("as_param", re"undefined", infer_param) |
| 133 |
} |
| 134 |
|
| 135 |
func f(i int) {} |
| 136 |
-- @infer_param/param.go -- |
| 137 |
@@ -7 +7,4 @@ |
| 138 |
+func as_param() int { |
| 139 |
+ panic("unimplemented") |
| 140 |
+} |
| 141 |
+ |
| 142 |
-- assign.go -- |
| 143 |
package missingfunction |
| 144 |
|
| 145 |
func inferFromAssign() { |
| 146 |
i := 42 |
| 147 |
i = i |
| 148 |
i = assign() //@quickfix("assign", re"undefined", infer_assign) |
| 149 |
} |
| 150 |
-- @infer_assign/assign.go -- |
| 151 |
@@ -8 +8,4 @@ |
| 152 |
+ |
| 153 |
+func assign() int { |
| 154 |
+ panic("unimplemented") |
| 155 |
+} |