Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / refactor / eg / testdata / expr_type_mismatch.template
1 package template
2
3 import (
4         "crypto/x509"
5         "fmt"
6 )
7
8 // This test demonstrates a false negative: according to the language
9 // rules this replacement should be ok, but types.Assignable doesn't work
10 // in the expected way (elementwise assignability) for tuples.
11 // Perhaps that's even a type-checker bug?
12 const shouldFail = "(n int, err error) is not a safe replacement for (key interface{}, err error)"
13
14 func before() (interface{}, error) { return x509.ParsePKCS8PrivateKey(nil) }
15 func after() (interface{}, error)  { return fmt.Print() }