1. A method for ensuring type safe linkage, comprising: identifying a first class that references an attribute that (i) is contained in a second class and (ii) is of a specified type; imposing a constraint on program instructions that the specified type when loaded by a loader that defines the first class is the same as the specified type when loaded by a loader that defines the second class; and verifying compliance with the constraint.