Example #1
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);
         }
     }
 }