@Nullable
    private Type parseAndResolve(String file) {
        try {
            Node ast = getAstForFile(file);

            if (ast == null) {
                failedToParse.add(file);
                return null;
            } else {
                Type type = Node.transformExpr(ast, globaltable);
                if (!loadedFiles.contains(file)) {
                    loadedFiles.add(file);
                    loadingProgress.tick();
                }
                return type;
            }
        } catch (OutOfMemoryError | StackOverflowError e) {
            if (astCache != null) {
                astCache.clear();
            }
            System.gc();
            if(e instanceof OutOfMemoryError) {
                _.msg("Skiping for memory size limit: " + file);
            }
            if(e instanceof StackOverflowError) {
                _.msg("Skiping for stack size limit: " + file);
            }
            return null;
        }
    }