blob: 00e00b1c419ed301ade6c45b2490b4c20ca0da2f [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 any, err error)"
func before() (interface{}, error) { return x509.ParsePKCS8PrivateKey(nil) }
func after() (interface{}, error) { return fmt.Print() }