gopls/internal/test/marker/testdata/completion/issue70636.txt
raw| 1 | This test reproduces the crash of golang/go#70636, an out of bounds error when |
| 2 | analyzing a return statement with more results than the signature expects. |
| 3 | |
| 4 | -- flags -- |
| 5 | -ignore_extra_diags |
| 6 | |
| 7 | -- go.mod -- |
| 8 | module example.com |
| 9 | |
| 10 | go 1.21 |
| 11 | |
| 12 | -- p.go -- |
| 13 | package p |
| 14 | |
| 15 | var xx int |
| 16 | var xy string |
| 17 | |
| 18 | |
| 19 | func _() { |
| 20 | return Foo(x) //@ rank(re"x()", "xx", "xy") |
| 21 | } |
| 22 | |
| 23 | func Foo[T any](t T) T {} |