go-python / go-python/gopy

does not work properly with type aliases across packages

オープン
#237 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
2.3k
フォーク
136
平均マージ
14分
マージ済み PR(30日)
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 を短くまとめたダイジェスト。