public MSBuildValueKind ResolveType(ExpressionPropertyNode node)
        {
            if (node is ExpressionPropertyName)
            {
                return(MSBuildValueKind.Unknown);
            }

            if (node is ExpressionPropertyFunctionInvocation inv)
            {
                if (inv.Target is ExpressionClassReference classRef)
                {
                    var info = GetStaticPropertyFunctionInfo(classRef.Name, inv.Function.Name);
                    return(info.ReturnType);
                }

                //FIXME: maybe this could pass the types along directly instead of constantly converting
                var targetType = ResolveType(inv.Target);

                //FIXME: overload resolution
                var match = Find(GetInstanceFunctions(targetType, true, true), inv.Function?.Name);
                if (match != null)
                {
                    return(match.ReturnType);
                }
                return(MSBuildValueKind.Unknown);
            }

            return(MSBuildValueKind.Unknown);
        }
Example #2
0
 public ExpressionPropertyFunctionInvocation(int offset, int length, ExpressionPropertyNode target, ExpressionFunctionName function, ExpressionArgumentList arguments)
     : base(offset, length)
 {
     Target = target;
     target?.SetParent(this);
     Function = function;
     function?.SetParent(this);
     Arguments = arguments;
     arguments?.SetParent(this);
 }