Format | Assembly Format | Description |
---|---|---|
C2 <T> | refanyval type |
Push the address stored in a typed reference. |
…, TypedRef → …, address
Retrieves the address (of type &
) embedded in TypedRef. The type of reference in TypedRef shall match the type specified by type (a metadata token, either a typedef
, typeref
or a typespec
; see Partition II). See the mkrefany
instruction.
System.InvalidCastException
is thrown if type is not identical to the type stored in the TypedRef (ie, the class supplied to the mkrefany
instruction that constructed that TypedRef)
System.TypeLoadException
is thrown if type cannot be found.
Correct CIL ensures that TypedRef is a valid typed reference (created by a previous call to mkrefany
).
The refanyval
instruction is always verifiable.