I agree that (b), (c), (d) use type inference but not (a) because in (a), 
both "num1" and "100" are untyped constants so they don't have types so 
there is no need to use type inference.

(a) const num1 = 100
(b) var num2 = num1

(c) const num1 = int(100)
(d) num2 := num1

However, if type inference is used to infer that "num1" is untyped from 
untyped "100", I agree that (a) also uses type inference.
(a) const num1 = 100
2019年2月4日月曜日 2時43分45秒 UTC+9 伊藤和也:
>
> In all the constant and variable declarations below, is type inference 
> used? If not, which declarations use type inference?
> (a) const num1 = 100
> (b) var num2 = num1
>
> (c) const num1 = int(100)
> (d) num2 := num1
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to