Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> the compiler should not complain that the expression is of type u8 and not u16 - it is safe to widen the type!

I'm actually glad it does because it often means there's an error. An explicit type cast is the way to go IMO.



I agree; it was probably an error to mix those types (though one that will probably raise errors elsewhere should it genuinely be problematic) and it makes everything clearer if it must be explicit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: