Beispiel #1
0
 /// <summary>
 /// Create a new TypeResolver
 /// </summary>
 private TypeResolver(
     StepFactoryStore stepFactoryStore,
     Dictionary <VariableName, TypeReference>?myDictionary = null)
 {
     StepFactoryStore = stepFactoryStore;
     MyDictionary     = myDictionary ?? new Dictionary <VariableName, TypeReference>();
 }
Beispiel #2
0
        /// <summary>
        /// Tries to create a new TypeResolver.
        /// </summary>
        public static Result <TypeResolver, IError> TryCreate(
            StepFactoryStore stepFactoryStore,
            TypeReference expectedStepOutputType,
            IFreezableStep topLevelStep)
        {
            var typeResolver = new TypeResolver(stepFactoryStore);

            var r = typeResolver.TryAddTypeHierarchy(expectedStepOutputType, topLevelStep);

            if (r.IsFailure)
            {
                return(r.ConvertFailure <TypeResolver>());
            }

            return(typeResolver);
        }