summaryrefslogtreecommitdiffstats
path: root/llgo/test/execution/interfaces/embedded.go
blob: 053afb1c6025d986f024ad03cb7ff10573f0da73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// RUN: llgo -o %t %s
// RUN: %t 2>&1 | FileCheck %s

// CHECK: A
// CHECK-NEXT: B

package main

type BI interface {
	B()
}

type AI interface {
	A()
	BI
}

type S struct{}

func (s S) A() {
	println("A")
}

func (s S) B() {
	println("B")
}

func main() {
	var ai AI = S{}
	ai.A()
	ai.B()
}
OpenPOWER on IntegriCloud