 During compilation of programs written in a type-safe language, such as Java, the source code must type-check successfully before compilation.If the type-check fails, the compilation will not be performed, and the source code needs to be modified.This means that, given a correct compiler, any code compiled from a successfully type-checked source program should be clear of invalid assignment errors.