CPC G06F 8/24 (2013.01) | 20 Claims |
1. A method, implemented at a computer system that includes a processor, for utilizing role types that extend underlying types at a runtime executing on the processor, the method comprising:
at the runtime, identifying a first statement within a program definition, the first statement assigning an object of an underlying type to a role type that extends the underlying type, wherein:
the underlying type implements a first interface, and
the role type implements a second interface;
at the runtime, assigning the object of the underlying type to the role type based on the role type extending the underlying type, wherein, based on assigning the object of the underlying type to the role type, the role type is usable to interact with the object of the underlying type using both the first interface and the second interface;
at the runtime, reporting reference equality in response to identifying a second statement comparing a first reference to an object of the role type and a second reference to the object of the underlying type; and
at the runtime, allocating a wrapper object around the object of the underlying type.
|