summaryrefslogtreecommitdiffstats
path: root/llgo/test/llgoi/interfaces.test
blob: 125e015791619097f7f3304ec8bc244b7ea299a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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
OpenPOWER on IntegriCloud