go-python / go-python/gopy

does not work properly with type aliases across packages

未关闭
#237 0 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
2.3k
派生
136
平均合并
14 分钟
30 天内合并 PR
2

描述

I defined an alias like this:

```go
package gi
...
type Color = gist.Color
```

gopy then redefined the source type information (gist.Color), in the aliased package (gi), and this leads to mysterious error messages, in my case of the form:

./gi.go:50598:41: Go type not supported in export: C.uchar

C.uchar was the return type of a method that was being redefined.

I haven't tested type aliases within packages -- might work there because name will be the same?

I tried just skipping these types, in `bind/symbols.go:567`:

```Go
case *types.TypeName:
tn := obj.(*types.TypeName)
if tn.IsAlias() {
fmt.Printf("type is an alias: %v\n", tn)
return nil
}
```

It detects the alias just fine, but this didn't fix the problem. not sure why.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。