Skip to content

go/types: "const _ string = 1" error message says integers can't be converted to strings #22070

@mdempsky

Description

@mdempsky

Compiling this package with cmd/compile (or go/types) produces an error message that 1 cannot be "converted" to type string. In fact it can be converted, it just can't be assigned, which is the criteria required here by the language spec.

package p
const _ string = 1

/cc @griesemer

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