Re:Proposal: expression to create pointer to simple types
by masklinn on Monday April 19, 2021 @11:21AM
(#26863729)
> Would it be possible to change the Go compiler such that 3 has a type? (I'm guessing no, at least not easily, otherwise he'd be suggesting it, but I'm curious about the reason)
Why not? In fact it already kind-of does: Go has "default types" for most untyped constants. When you write
i := 3
absent an explicit type, Go will fall back to "int".
Why not? In fact it already kind-of does: Go has "default types" for most untyped constants. When you write
absent an explicit type, Go will fall back to "int".