<commit_before>import com.redhat.ceylon.compiler.typechecker.parser {
    CeylonLexer
}
import com.redhat.ceylon.compiler.typechecker.tree {
    Visitor,
    Node,
    Tree
}

import org.antlr.runtime {
    CommonToken
}

object typeConstructorVisitor extends Visitor() {
    function dummyBaseType(Tree.TypeConstructor typeConstructor) {
        value replacement = Tree.BaseType(typeConstructor.token);
        replacement.declarationModel = typeConstructor.declarationModel;
        replacement.typeModel = typeConstructor.typeModel;

        value identifier = Tree.Identifier(null);
        value token = CommonToken(CeylonLexer.\iUIDENTIFIER, "dummy");
        token.startIndex = 0;
        token.stopIndex = 5;
        identifier.token = token;
        identifier.text = "dummy";
        replacement.identifier = identifier;

        return replacement;
    }

    shared actual
    void visitAny(Node that) {
        super.visitAny(that);
    }

    shared actual
    void visit(Tree.TypedDeclaration that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.TypeOperatorExpression that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }


    shared actual
    void visit(Tree.SpreadType that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.SatisfiesCase that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.IsCase that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.IsCondition that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.TypedArgument that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.FunctionArgument that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.SatisfiesCondition that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.SequencedType that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.DefaultedType that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.TypeSpecifier that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }
}
<commit_msg>support anonymous type functions as type arguments<commit_after>import com.redhat.ceylon.compiler.typechecker.parser {
    CeylonLexer
}
import com.redhat.ceylon.compiler.typechecker.tree {
    Visitor,
    Node,
    Tree
}

import org.antlr.runtime {
    CommonToken
}

object typeConstructorVisitor extends Visitor() {
    function dummyBaseType(Tree.TypeConstructor typeConstructor) {
        value replacement = Tree.BaseType(typeConstructor.token);
        replacement.declarationModel = typeConstructor.declarationModel;
        replacement.typeModel = typeConstructor.typeModel;

        value identifier = Tree.Identifier(null);
        value token = CommonToken(CeylonLexer.\iUIDENTIFIER, "dummy");
        token.startIndex = 0;
        token.stopIndex = 5;
        identifier.token = token;
        identifier.text = "dummy";
        replacement.identifier = identifier;

        return replacement;
    }

    shared actual
    void visitAny(Node that) {
        super.visitAny(that);
    }

    shared actual
    void visit(Tree.TypedDeclaration that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.TypeOperatorExpression that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }


    shared actual
    void visit(Tree.SpreadType that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.SatisfiesCase that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.IsCase that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.IsCondition that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.TypedArgument that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.FunctionArgument that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.SatisfiesCondition that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.SequencedType that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.DefaultedType that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.TypeSpecifier that) {
        if (is Tree.TypeConstructor typeConstructor = that.type) {
            that.type = dummyBaseType(typeConstructor);
        }
        super.visit(that);
    }

    shared actual
    void visit(Tree.TypeArgumentList that) {
        for (i in 0:that.types.size()) {
            if (is Tree.TypeConstructor typeConstructor = that.types.get(i)) {
                that.types.set(i, dummyBaseType(typeConstructor));
            }
        }
        super.visit(that);
    }
}

{'fraction_non_alphanumeric': 0.09193027759845061, 'fraction_numerical': 0.0006455777921239509, 'mean_word_length': 2.2919677008074797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1094163', 'n_tokens_mistral': 2125, 'n_tokens_neox': 2085, 'n_words': 435}