Skip to content

cmd/compile: make the variable a func literal is assigned to available inside the function #46037

@ghost

Description

This doesn't compile (undefined: f):

f := func() { f() }

I don't see why it shouldn't.

This compiles:

var f func()
f = func() { f() }

This doesn't, again:

var f = func() { f() }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions