Skip to content

go/types, types2: type checker accepts import of package called "init" #43962

@griesemer

Description

@griesemer

Given two packages (for convenience represented via single files both stored in the same directory):

a.go: package init
b.go: package b; import "./a"

the compiler reports "cannot import package as init - init must be a func", but the go/types and types2 accept this (though they correctly don't accept a local rename to init).

cc: @findleyr

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions