public Type resolve(Scope s, int tag) {

        Type opType = resolveExpr(func, s, tag);
        List<Type> aTypes = resolveAndConstructList(args, s, tag);
        Map<String, Type> kwTypes = new HashMap<String, Type>();

        for (Keyword kw : keywords) {
            kwTypes.put(kw.getArg(), kw.getValue().resolve(s, 0));
        }

        Type kwargsType = kwargs == null ? null : resolveExpr(kwargs, s, tag);
        Type starargsType = starargs == null ? null : resolveExpr(starargs, s, tag);

        if (opType.isUnionType()) {
            Set<Type> types = opType.asUnionType().getTypes();
            Type retType = Indexer.idx.builtins.unknown;
            for (Type funcType : types) {
                Type t = resolveCall(funcType, aTypes, kwTypes, kwargsType, starargsType, tag);
                retType = UnionType.union(retType, t);
            }
            return retType;
        } else {
            return resolveCall(opType, aTypes, kwTypes, kwargsType, starargsType, tag);
        }
    }