Skip to content

Commit

Permalink
Support pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Dec 13, 2023
1 parent 07cf036 commit c3f527f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (g *genericInstance) partial() bool {
}

func (g *genericInstance) scanRecvTypeArgs(fn func(*types.TypeParam, int, types.Type)) {
typeParams := g.recvType.TypeParams()
typeParams := g.instance.Signature.RecvTypeParams()
typeArgs := g.recvType.TypeArgs()
for i := 0; i < typeArgs.Len(); i++ {
arg := typeArgs.At(i)
Expand Down Expand Up @@ -583,6 +583,9 @@ func writeGoShape(b *strings.Builder, tt types.Type) {
switch t := tt.Underlying().(type) {
case *types.Basic:
b.WriteString(t.Name())
case *types.Pointer:
// All pointers resolve to *uint8.
b.WriteString("*uint8")
case *types.Interface:
if t.Empty() {
b.WriteString("interface{}")
Expand Down

0 comments on commit c3f527f

Please sign in to comment.