Skip to content

cmd/fix, x/tools/internal/refactor/inline: inlining 1 << f() may produce a constant (1 << 123) that is too large #78170

@zigo101

Description

@zigo101

Go version

go version go1.26.1 linux/amd64

Output of go env in your module/workspace:

.

What did you do?

package main

//go:fix inline
func foo() int {
	return 123
}

func main() {
	_ = 1 << foo()
}

What did you see happen?

fails to compile now

What did you expect to see?

still compiles

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions