echo("Hello World!")
# Try a type which may or may not have system.cmp[T].
when true:
type X = object
var a,b : X
else:
type X = int
var
a = 1
b = 2
#echo system.cmp[X](a,b) # does not compile
# Test whether this program fails to compile,
# even when we do not actually call system.cmp.
when true:
proc foo(u,v: X, diff: proc (x,y: X): int = system.cmp) =
echo diff(u, v)
else:
proc foo(u,v: X, diff: proc (x,y: X): int) =
echo diff(u, v)
proc mydiff(x,y: X): int =
echo "mydiff"
return 0
foo(a, b, mydiff)
#foo(a, b) # Obviously, this is not possible, but that's not the point.