private bool TryRegisterIntrinsic <TResolver>(
                TResolver resolver,
                IntrinsicMapping <TDelegate> mapping)
                where TResolver : struct, IntrinsicMapping.IGenericArgumentResolver
            {
                if (mapping.Mode != IntrinsicImplementationMode.Redirect)
                {
                    return(false);
                }

                lock (mappings)
                {
                    var redirect = mapping.ResolveRedirect(
                        resolver,
                        out var genericMapping);
                    if (!mappings.ContainsKey(redirect))
                    {
                        var result = codeGenerationPhase.GenerateCode(redirect);
                        mappings.Add(
                            redirect,
                            new MappingEntry(mapping, genericMapping, result));
                    }
                }
                return(true);
            }
 /// <summary>
 /// Constructs a new mapping entry.
 /// </summary>
 /// <param name="mapping">The parent mapping.</param>
 /// <param name="mappingKey">The current mapping key.</param>
 /// <param name="codeGenerationResult">
 /// The intermediate code-generation result.
 /// </param>
 public MappingEntry(
     IntrinsicMapping <TDelegate> mapping,
     IntrinsicMapping.MappingKey mappingKey,
     CodeGenerationResult codeGenerationResult)
 {
     Mapping              = mapping;
     MappingKey           = mappingKey;
     CodeGenerationResult = codeGenerationResult;
 }
 /// <summary cref="IDataProvider{TResult}.GetData{TResolver}(
 /// IntrinsicMapping{TDelegate}, TResolver)"/>
 public TDelegate GetData <TResolver>(
     IntrinsicMapping <TDelegate> mapping,
     TResolver resolver)
     where TResolver : struct, IntrinsicMapping.IGenericArgumentResolver =>
 mapping.ResolveCodeGenerator(resolver);
 /// <summary cref="IDataProvider{TResult}.GetData{TResolver}(
 /// IntrinsicMapping{TDelegate}, TResolver)"/>
 public Method GetData <TResolver>(
     IntrinsicMapping <TDelegate> mapping,
     TResolver resolver)
     where TResolver : struct, IntrinsicMapping.IGenericArgumentResolver =>
 mapping.ResolveImplementation(resolver);