US 12,079,595 B2
Runtime support for role types that extend underlying types
David Charles Wrighton, Redmond, WA (US); Julien David Couvreur, Kirkland, WA (US); Stephen Harris Toub, Winchester, MA (US); Mads Torgersen, Seattle, WA (US); and Jared Porter Parsons, Kirkland, WA (US)
Assigned to Microsoft Technology Licensing, LLC, Redmond, WA (US)
Filed by Microsoft Technology Licensing, LLC, Redmond, WA (US)
Filed on Jun. 29, 2022, as Appl. No. 17/853,004.
Prior Publication US 2024/0004616 A1, Jan. 4, 2024
Int. Cl. G06F 8/20 (2018.01)
CPC G06F 8/24 (2013.01) 20 Claims
OG exemplary drawing
 
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.