#Struct embedding throws NPE

1 messages · Page 1 of 1 (latest)

rugged drum
#

Here's a minimal repro

package main

type Embed struct {
    Name string
}

func New(
    // +optional
    // +default="nipuna"
    name string,
) *Embed {
    return &Embed{
        Name: name,
    }
}

type Second struct {
    *Embed
}

func (e *Embed) GetSeconds() *Second {
    return &Second{e}
}

func (s *Second) PrintName() string {
    return s.Name
}
twin oxide
rugged drum
#

I think what I'm seeing is slightly different. Are embedded fields supposed to work?

twin oxide
#

Ah I'm on mobile so can't repro, but I expect this is related

#

If you could chuck your repro into the issue, I'll make sure to try and fix as part of the one I have in the works

twin oxide
rugged drum