proposal: Go 2: spec: allow untyped float const multiplied by typed integer constants (2.5*time.Hour) #32666
Labels
LanguageChange
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Proposal
v2
A language change or incompatible library change
Milestone
What version of Go are you using (
go version
)?What did you do?
https://play.golang.org/p/klT3SFB7BJE
What did you expect to see?
2h30m0s
What did you see instead?
./prog.go:9:23: constant 2.5 truncated to integer
In the code I'm multiplying a constant with a constant and according to https://blog.golang.org/constants this should just work. But somehow it doesn't.
The text was updated successfully, but these errors were encountered: