/// <summary> /// Returns the value that is assigned to the given parameter. /// </summary> /// <param name="parameter">The parameter to map to a value.</param> /// <returns>The mapped value.</returns> public readonly ValueReference this[Parameter parameter] { get { Method.AssertNotNull(parameter); Method.Assert(parameter.Method == Method); return(Arguments[parameter.Index]); } }
/// <summary> /// Constructs a new parameter mapping. /// </summary> /// <param name="method">The associated method.</param> /// <param name="arguments">The parameter arguments.</param> internal ParameterMapping( Method method, ReadOnlySpan <ValueReference> arguments) { method.AssertNotNull(method); method.Assert(arguments.Length == method.Parameters.Count); Method = method; Arguments = arguments; }