Let's assume I have these types
type MyInt int
type Ints []int
type MyInts []MyInt
Using these types I define some variables
var is []int
var ints Ints
var myInts MyInts
The variables is and ints have different type, however the compiler happily compiles this line
is = ints
Similarly is and myInts have different types, but in this case the following line is not compiled because the types of the variables are different
is = myInts
So, why in the first case the difference of types does not stop comlilation, while in the second case it does stop it?
Here a simple playground that reproduces the case.