Skip to content

go/types, types2: missing error for shifts by huge untyped integers #43697

@griesemer

Description

@griesemer

Per the spec:

The right operand in a shift expression must have integer type or be an untyped constant representable by a value of type uint.

for the following code

package p

var x int
var _ = x << 100000000000000000000

go/types (and types2) should report an error but doesn't.

For reference, cmd/compile reports

main.go:4:11: constant 100000000000000000000 overflows uint

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