public Variable ExplicitConvert(Variable variable, NType targetType) { Debug.Assert(variable.Type == this); var retVariable = this.ExplicitConvertFunc(variable, targetType); if (Object.ReferenceEquals(retVariable, variable)) { return(retVariable); } // add connection var newCon = new VariableConnection() { OperationType = VariableOperationType.TypeCast_Trim }; newCon.InVariables.Add(variable); newCon.OutVariables.Add(retVariable); retVariable.ParentConnections.Add(newCon); return(retVariable); }
public Variable Assign(Variable variable, NType type) { return(this.ImplicitConvert(variable, type)); }