public bool VisitDropNode(DropNode dropNode)
        {
            VariableUsageValidator validator = dropNode.Terminals[0].GetValidator();

            validator.TestVariableIsOwnedType();
            return(true);
        }
 public bool VisitExplicitBorrowNode(ExplicitBorrowNode explicitBorrowNode)
 {
     foreach (var inputTerminal in explicitBorrowNode.InputTerminals)
     {
         VariableUsageValidator validator = inputTerminal.GetValidator();
     }
     return(true);
 }
示例#3
0
        public bool TestSameUnderlyingTypeAs(VariableUsageValidator other)
        {
            if (!_terminalHasType)
            {
                return(false);
            }
            NIType otherUnderlyingType = other._facadeVariable.Type.GetTypeOrReferentType();

            return(TestExpectedUnderlyingType(otherUnderlyingType));
        }
        public bool VisitTerminateLifetimeNode(TerminateLifetimeNode terminateLifetimeNode)
        {
            foreach (var inputTerminal in terminateLifetimeNode.InputTerminals)
            {
                VariableUsageValidator validator = new VariableUsageValidator(inputTerminal, false);
            }

            switch (terminateLifetimeNode.ErrorState)
            {
            case TerminateLifetimeErrorState.InputLifetimesNotUnique:
                terminateLifetimeNode.SetDfirMessage(Messages.TerminateLifetimeInputLifetimesNotUnique);
                break;

            case TerminateLifetimeErrorState.InputLifetimeCannotBeTerminated:
                terminateLifetimeNode.SetDfirMessage(Messages.TerminateLifetimeInputLifetimeCannotBeTerminated);
                break;

            case TerminateLifetimeErrorState.NotAllVariablesInLifetimeConnected:
                terminateLifetimeNode.SetDfirMessage(Messages.TerminateLifetimeNotAllVariablesInLifetimeConnected);
                break;
            }
            return(true);
        }