/// <summary> /// Checks if it is possible to monomorphize this type /// </summary> /// <returns><c>true</c>, if monomorphize was tryed, <c>false</c> otherwise.</returns> /// <param name="ExpectedType">The type that this type is supposed to be after monomorphization</param> /// <param name="TypeArgs">A list of already resolved type arguments.</param> /// <param name="ExpectedTypeArgs">A list of all the expected type arguments.</param> public bool TryMonomorphize(Ty ExpectedType, ref Dictionary <string, Ty> TypeArgs, string[] ExpectedTypeArgs) { // if the type is already resolved, check for equality if (TypeArgs.ContainsKey(this.Name)) { return(TypeArgs[this.Name] == ExpectedType); } // if it is expected to be resolved, do it if (ExpectedTypeArgs.Contains(this.Name)) { TypeArgs[this.Name] = ExpectedType; return(true); } // otherwise check the inner type return(this.Type.TryMonomorphize(ExpectedType.Type, ref TypeArgs, ExpectedTypeArgs)); }
public ListType(Ty listElementsType) { ListElementsType = listElementsType; }