Example #1
0
 public virtual void VisitStaticFunctionCall(BoundStaticFunctionCall x)
 {
     VisitTypeRef(x.TypeRef);
     VisitRoutineCall(x);
 }
Example #2
0
 public virtual void VisitStaticFunctionCall(BoundStaticFunctionCall x)
 {
     VisitTypeRef(x.TypeRef);
     VisitRoutineCall(x);
 }
 public virtual TResult VisitStaticFunctionCall(BoundStaticFunctionCall x) => VisitRoutineCall(x);
Example #4
0
        public override void VisitStaticFunctionCall(BoundStaticFunctionCall x)
        {
            VisitTypeRef(x.TypeRef);

            VisitRoutineCall(x);

            Accept(x.Name.NameExpression);

            if (x.Name.IsDirect && x.TypeRef.ResolvedType != null)
            {
                // TODO: resolve all candidates, visibility, static methods or instance on self/parent/static
                var candidates = x.TypeRef.ResolvedType.LookupMethods(x.Name.NameValue.Name.Value);
                // if (candidates.Any(c => c.HasThis)) throw new NotImplementedException("instance method called statically");

                var args = x.ArgumentsInSourceOrder.Select(a => a.Value.TypeRefMask).ToArray();
                x.TargetMethod = new OverloadsList(candidates.ToArray()).Resolve(this.TypeCtx, args, this.TypeCtx.ContainingType);
            }

            VisitRoutineCallEpilogue(x);
        }