Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create []<func type> with a slice of <the function types> #3

Open
theclapp opened this issue Feb 16, 2021 · 0 comments
Open

Can't create []<func type> with a slice of <the function types> #3

theclapp opened this issue Feb 16, 2021 · 0 comments
Assignees
Labels
bug Something isn't working yaegi Bug in Yaegi interpreter

Comments

@theclapp
Copy link
Collaborator

theclapp commented Feb 16, 2021

(Yaegi issue.)

See https://github.com/gioui/gio-example/blob/d6ec266262f41bfc815c4c7bea0f33a2468f9167/kitchen/kitchen.go#L245

	widgets := []layout.Widget{
		material.H3(th, topLabel).Layout,
		func(gtx C) D {
			gtx.Constraints.Max.Y = gtx.Px(unit.Dp(200))
			return material.Editor(th, editor, "Hint").Layout(gtx)
		},
		// ...

layout.Widget is type Widget func(gtx Context) Dimensions

The first Layout might actually work?

The second definitely breaks: Eval error: 40:56: cannot use type as type gioui.org/layout.Widget. Note the type<space><space>as type....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working yaegi Bug in Yaegi interpreter
Projects
None yet
Development

No branches or pull requests

1 participant