6. The engine of claim 1 , the variance verification component performs a check each time an assignment is performed on a variable whose type is marked as covariant.
1. At a computer system, the computer system including: one or more processors; system memory; and one or more computer storage media having stored thereon computer executable instructions representing an execution engine, the execution comprising: an input component that receives a program executable including intermediate language instructions, the intermediate language instructions including run-time checks, the run-time checks having been emitted into the intermediate language instructions by a source language compiler during compilation from source language instructions into the intermediate language instructions, the run-time checks for verifying compliance with variance requirements of the source language during execution of the intermediate language instructions in order to maintain type safety, the run-time checks including intermediate language instructions for checking: (i) verifying covariance between different generic types by checking for implicit reference conversions between different generic types of the source language during run-time in response to detecting that a write instruction is to be executed and (ii) verifying contra-variance between different generic types by checking for implicit reference conversions between different generic types of the source language during run-time in response to detecting that a read instruction is to be executed; and a variance verification component, wherein the variance verification component is configured to: verify compliance with covariance requirements for write instructions, including: detect that a write instruction is to be executed to convert a value from a first generic type to a second different generic type; prior to executing the write instruction, execute an emitted run-time check applicable to the write instruction to check for an implicit reference conversion from the first generic type to the second generic type; determine when there is not an implicit reference conversion from the first generic type to the second generic type from the results of the applicable run-time check; and provide error information related to the write instruction in response to determining that the implicit reference conversion does not exist; and verify compliance with contra-variance requirements for read instructions, including: detect that a read instruction is to be executed to convert a value from a third generic type to a fourth different generic type; prior to executing the read instruction, execute an emitted run-time check applicable to the read instruction to check for an implicit reference conversion from the third generic type to the fourth generic type; determine when there is not an implicit reference conversion from the third generic type to the fourth generic type from the results of the applicable run-time check; and provide error information related to the read instruction in response to determining that the implicit reference conversion does not exist.