| 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 any, err error)" |
| 13 | |
| 14 | func before() (interface{}, error) { return x509.ParsePKCS8PrivateKey(nil) } |
| 15 | func after() (interface{}, error) { return fmt.Print() } |
| 16 |
Members