1. A non-transitory, computer-readable storage medium storing program instructions that when executed on a computing device cause the computing device to perform: generating, by a compiler, a class file based on a class declaration, wherein said generating comprises: applying a type erasure operation to a stream of instructions in the class declaration, wherein the stream of instructions is configured for execution by a virtualized execution environment, and wherein the class declaration includes one or more type variables; wherein applying the type erasure operation comprises: creating an encoded form of a program element of the class declaration, wherein the encoded form of the program element comprises metadata specifying specialization information regarding the program element such that the encoded form can be specialized by the virtualized execution environment according to a particular type parameterization; and including the encoded form of the program element in the class file, wherein the program element is usable by the virtualized execution environment to load the program element without regard to the metadata being present in the encoded form.