<commit_before><commit_msg>Added test for #1846.<commit_after>type
    TBinOp*[T] = proc (x,y: T): bool

    THeap*[T] = object
        cmp*:   TBinOp[T]

proc less*[T](x,y: T): bool =
    x < y

proc initHeap*[T](cmp: TBinOp[T]): THeap[T] =
    result.cmp = cmp

when isMainModule:
    var h = initHeap[int](less[int])

    echo h.cmp(2,3)
{'fraction_non_alphanumeric': 0.17941176470588235, 'fraction_numerical': 0.01764705882352941, 'mean_word_length': 3.2098765432098766, 'pattern_counts': {'":': 0, '<': 4, '<?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': '7433882', 'n_tokens_mistral': 152, 'n_tokens_neox': 149, 'n_words': 32}