builder icon indicating copy to clipboard operation
builder copied to clipboard

`getWidget` in ispx

Open nighca opened this issue 1 year ago • 0 comments

https://github.com/goplus/builder/pull/676#discussion_r1718368773

Widget 目前有已知问题如下:

getWidget 的定义使用了泛型(见 Gopt_Game_Gopx_GetWidget),ispx 这里使用 qexp -outdir pkg github.com/goplus/spx 来生成 package spx 的导出信息供运行时使用;但 qexp 目前默认会跳过基于泛型的函数定义

➜ go generate
2024/08/15 20:12:28 process [github.com/goplus/spx]
2024/08/15 20:12:34 skip typeparam func github.com/goplus/spx.Gopt_Game_Gopx_GetWidget[T any](game interface{}, name string) *T
2024/08/15 20:12:34 export github.com/goplus/spx: pkg/github.com/goplus/spx/export.go
2024/08/15 20:12:34 process [github.com/hajimehoshi/ebiten/v2]
2024/08/15 20:12:39 export github.com/hajimehoshi/ebiten/v2: pkg/github.com/hajimehoshi/ebiten/v2/export.go

因此游戏的代码中无法调用 getWidget

qexp 目前默认会跳过基于泛型的函数定义

这个可能可以通过指定 --src 来避免跳过,但那样会有新的问题,暂时还没有找到解决办法

nighca avatar Aug 16 '24 04:08 nighca