Skip to content

Inspect arguments in nested struct methods #1968

@bictorman

Description

@bictorman
package main

type Foo struct {
    bar Bar
}

type Bar struct {}
func (b *Bar) Args(a string) {}
func (b *Bar) NoArgs() {}

func main() {
    f := new(Foo)
    f.bar.Args() // should be an error
    f.bar.NoArgs("argument") // should be an error
}
./main.go:13: not enough arguments in call to f.bar.Args
./main.go:14: too many arguments in call to f.bar.NoArgs

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions