go/types: disagrees with compiler on float truncation when using export data #53803
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
Consider
with
The two constants are untyped floats, and their product is 500.0. The Go compiler accepts the function call. When using go/types, however, this only type checks if we're not loading
assist
from export data. If we are, then it fails withThe following txtar archive contains a module with a package
bug
that compiles fine usinggo build
, but fails to type check when loading with go/packages. Notably, this only fails when a) the constants are declared in an imported package b) the imported package is loaded from export data instead of from source.Output:
Input:
https://go.dev/play/p/LZfQZ7oKOcW.go
Possibly related to #45837
/cc @griesemer
The text was updated successfully, but these errors were encountered: