public Type resolve(@NotNull Scope s, int tag) {
        Type type1, type2;
        resolveExpr(test, s, tag);
        int newTag = Indexer.idx.newThread();

        if (body != null && !body.isEmpty()) {
            type1 = resolveExpr(body, s, newTag);
        } else {
            type1 = Indexer.idx.builtins.Cont;
        }

        Scope s2 = new Scope(s);
        if (orelse != null && !orelse.isEmpty()) {
            type2 = resolveExpr(orelse, s2, -newTag);
        } else {
            type2 = Indexer.idx.builtins.Cont;
        }

        return UnionType.union(type1, type2);
    }