Skip to content

cmd/compile: map literals should pass static size to constructor #16279

@randall77

Description

@randall77
func f(x, y, z int) map[int]int {
    return map[int]int{x: y, y: z, z: x}
}

This code calls runtime.makemap with 0 as the size hint. It should pass 3 as the size hint.

See #15880 for a similar issue about static maps.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions