what does it mean assigning a half4 to a float

half4 texcol = tex2D(_MainTex, i.uvMain);
texcol.a = texcol.a * tex2D(_AlphaTex, alphaCoords).rgb; //why the compiler doesnt complain an error, what does it mean assigning a half4 to a float

I haven’t tried it but I think it’s just the first component of the vector. I guess it can be useful when sampling grayscale textures where all channels have the same value (as it’s probably the case in the example). In any other scenario it would be really confusing. Personally I wouldn’t use it at all.