public static void UnifyWireInputTerminalTypes(this Wire wire, TerminalTypeUnificationResults typeUnificationResults) { // Merge the wire's input terminal with its connected source foreach (var wireTerminal in wire.InputTerminals) { var connectedNodeTerminal = wireTerminal.ConnectedTerminal; if (connectedNodeTerminal != null) { VariableReference wireVariable = wireTerminal.GetFacadeVariable(), nodeVariable = connectedNodeTerminal.GetFacadeVariable(); wireTerminal.UnifyTerminalTypeWith( wireVariable.TypeVariableReference, nodeVariable.TypeVariableReference, typeUnificationResults); wireVariable.MergeInto(nodeVariable); } } }
protected override void VisitWire(Wire wire) { // Merge the wire's input terminal with its connected source foreach (var wireTerminal in wire.InputTerminals) { var connectedNodeTerminal = wireTerminal.ConnectedTerminal; if (connectedNodeTerminal != null) { VariableReference wireVariable = wireTerminal.GetFacadeVariable(), nodeVariable = connectedNodeTerminal.GetFacadeVariable(); ITypeUnificationResult unificationResult = _typeUnificationResults.GetTypeUnificationResult( wireTerminal, wireVariable.TypeVariableReference, nodeVariable.TypeVariableReference); wireVariable.UnifyTypeVariableInto(nodeVariable, unificationResult); wireVariable.MergeInto(nodeVariable); } } }