Peter Collingbourne | ad9841e | 2014-11-27 00:06:42 +0000 | [diff] [blame] | 1 | // RUN: llgo -o %t %s |
2 | // RUN: %t 2>&1 | FileCheck %s | ||||
3 | |||||
4 | // CHECK: A | ||||
5 | // CHECK-NEXT: B | ||||
6 | |||||
7 | package main | ||||
8 | |||||
9 | type BI interface { | ||||
10 | B() | ||||
11 | } | ||||
12 | |||||
13 | type AI interface { | ||||
14 | A() | ||||
15 | BI | ||||
16 | } | ||||
17 | |||||
18 | type S struct{} | ||||
19 | |||||
20 | func (s S) A() { | ||||
21 | println("A") | ||||
22 | } | ||||
23 | |||||
24 | func (s S) B() { | ||||
25 | println("B") | ||||
26 | } | ||||
27 | |||||
28 | func main() { | ||||
29 | var ai AI = S{} | ||||
30 | ai.A() | ||||
31 | ai.B() | ||||
32 | } |