blob: 2c5c3f0dc6d85691a88ccc2fbe3e76daf12ffdb3 [file] [log] [blame]
package template
import (
"crypto/x509"
"fmt"
)
// This test demonstrates a false negative: according to the language
// rules this replacement should be ok, but types.Assignable doesn't work
// in the expected way (elementwise assignability) for tuples.
// Perhaps that's even a type-checker bug?
const shouldFail = "(n int, err error) is not a safe replacement for (key interface{}, err error)"
func before() (interface{}, error) { return x509.ParsePKCS8PrivateKey(nil) }
func after() (interface{}, error) { return fmt.Print() }