Structural representation of generic type variable in a nominally typed virtual machine
摘要:
Techniques herein process type variables to transform type parameters (TPs) of generic classes. In an embodiment, a computer stores a generic class attribute associated with a definition of a generic class. The generic class attribute includes a type variable declaration (TVD) for each TP. Each TVD is associated with usage entries (VUEs) within the definition. Each VUE indicates an actual type for use, within a portion of the definition, as the TP represented by the VUE. Based on how a particular portion of the definition uses a particular TP represented by a particular TVD of a particular VUE, the computer determines whether the particular VUE is to be assigned to a particular type or erased. In response to determining that the particular VUE is to be erased, the computer configures the particular VUE to indicate erasure. Otherwise, the computer assigns the particular type to the particular VUE.
信息查询
0/0