mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
fix nim-lang#19700 Crash when passing a template to a generic function expecting a procedure
11 lines
228 B
Nim
11 lines
228 B
Nim
discard """
|
|
errormsg: "type mismatch: got <Obj, Obj, template (x: untyped, y: untyped): untyped>"
|
|
"""
|
|
|
|
type Obj = object
|
|
|
|
proc apply[T, R](a, b: T; f: proc(x, y: T): R): R = f(a, b)
|
|
|
|
let a, b = Obj()
|
|
discard apply(a, b, `!=`)
|