forked from OSchip/llvm-project
23 lines
339 B
Plaintext
23 lines
339 B
Plaintext
// RUN: llgoi < %s | FileCheck %s
|
|
|
|
import "errors"
|
|
err := errors.New("foo")
|
|
err
|
|
// CHECK: foo
|
|
|
|
err.(interface{Foo()})
|
|
// CHECK: panic: interface conversion
|
|
|
|
_, ok := err.(interface{Foo()})
|
|
ok
|
|
// CHECK: false
|
|
|
|
err.(interface{Error() string})
|
|
// CHECK: foo
|
|
|
|
iface, ok := err.(interface{Error() string})
|
|
iface
|
|
// CHECK: foo
|
|
ok
|
|
// CHECK: true
|