/// <summary> /// Visits an invocation expression and adds an entry to the set of Reactive /// entities if it is an invocation of an unbound parameter with a Reactive /// entity type. /// </summary> /// <param name="node">The invocation expression to visit.</param> /// <returns>The result of visiting the invocation expression.</returns> protected override ExpressionSlim VisitInvocation(InvocationExpressionSlim node) { // If the expression is an invocation of an unbound parameter... if (node.Expression is ParameterExpressionSlim target && !TryLookup(target, out _)) { var reactiveEntityType = ReactiveEntityTypeExtensions.FromTypeSlim(target.Type); reactiveEntityType &= ~ReactiveEntityType.Func; AddToReactiveEntities(reactiveEntityType, target, node.Arguments); } return(base.VisitInvocation(node)); }
/// <summary> /// Visits a parameter expression and adds an entry to the entities list if /// the parameter type is a Reactive entity type. /// </summary> /// <param name="node">The parameter expression.</param> /// <returns>The result of visiting the parameter expression.</returns> protected override ExpressionSlim VisitParameter(ParameterExpressionSlim node) { // If the expression is an unbound parameter... if (!TryLookup(node, out _)) { var reactiveEntityType = ReactiveEntityTypeExtensions.FromTypeSlim(node.Type); // ... that is not a parameterized Reactive entity type... if ((reactiveEntityType & ReactiveEntityType.Func) != ReactiveEntityType.Func) { AddToReactiveEntities(reactiveEntityType, node, Array.Empty <ExpressionSlim>()); } } return(base.VisitParameter(node)); }