private static DynamicCastPrototype DecodeDynamicCast(IReadOnlyList <LNode> data, DecoderState state)
        {
            var targetType = state.DecodeType(data[0]);

            if (targetType is PointerType)
            {
                return(DynamicCastPrototype.Create((PointerType)targetType));
            }
            else
            {
                state.Log.LogSyntaxError(
                    data[0],
                    new Text("expected a pointer type."));
                return(null);
            }
        }
 /// <summary>
 /// Creates a dynamic cast instruction that converts
 /// from one pointer type to another.
 /// </summary>
 /// <param name="targetType">
 /// A type to convert operands to.
 /// </param>
 /// <param name="operand">
 /// An operand to convert to the target type.
 /// </param>
 /// <returns>
 /// A dynamic cast instruction.
 /// </returns>
 public static Instruction CreateDynamicCast(
     PointerType targetType, ValueTag operand)
 {
     return(DynamicCastPrototype.Create(targetType).Instantiate(operand));
 }