private static bool HasCorrectType(Conditional node, Dictionary <Id, Types.Type> identifierToType) { var collector = new ExpressionTypeCollector(identifierToType); return(node.Condition.Accept(collector).IsEqual(new Types.BoolType()) && !ContainsError(collector.GetCollectedNotifications())); }
private static IEnumerable <INotification> CheckExpressionsHaveType(IList <IExpression> topLevelExpressions, Dictionary <Id, Types.Type> identifierToType) { List <INotification> notifications = new List <INotification>(); foreach (IExpression expr in topLevelExpressions) { ExpressionTypeCollector collector = new ExpressionTypeCollector(identifierToType); expr.Accept(collector); notifications.AddRange(collector.GetCollectedNotifications()); } return(notifications); }