Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/arm/go/test/fixedbugs/issue6399.go

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


// compile

package main

type Foo interface {
	Print()
}

type Bar struct{}

func (b Bar) Print() {}

func main() {
	b := make([]Bar, 20)
	f := make([]Foo, 20)
	for i := range f {
		f[i] = b[i]
	}
	T(f)
	_ = make([]struct{}, 1)
}

func T(f []Foo) {
	for i := range f {
		f[i].Print()
	}
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].