Thank for expanding on that. As a Go newbie, I didn't see how Jan's
response answered your question, but you made it clear.
On Sunday, November 18, 2018 at 4:34:00 PM UTC-6, gith...@gmail.com wrote:
>
> Thank you Jan,
> I read the spec a bit more carefully after you pointed it out and I now
> un
Thank you Jan,
I read the spec a bit more carefully after you pointed it out and I now
understand that a constant and a non-constant value are treated differently
and that my examples above is an example of just this.
"A constant value x can be converted to type T if x is representable by a
val
It feels awkward...I’ve always felt the limit should be removed after the
innermost cast because that’s when the programmer has said “treat this as
type A” and then says “treat an A as a B with every implication that a
narrowing conversion causes.”
On Sun, Nov 18, 2018 at 9:55 AM Jan Mercl <0xj...
On Sun, Nov 18, 2018 at 6:42 PM wrote:
It's consistent with the language specification ;-)
A constant value x can be converted to type T if x is representable by a
value of T.
https://golang.org/ref/spec#Conversions
--
-j
--
You received this message because you are subscribed to the Goog