Exemplo n.º 1
0
 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);
         }
     }
 }
Exemplo n.º 2
0
 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);
         }
     }
 }