mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-14 23:53:47 +00:00
Fixes https://github.com/nim-lang/Nim/issues/25655 --------- Co-authored-by: Andreas Rumpf <araq4k@proton.me>
13 lines
332 B
Nim
13 lines
332 B
Nim
discard """
|
|
cmd: "nim check $file"
|
|
action: compile
|
|
nimout: '''
|
|
tinvalid_cmp_op3.nim(12, 1) Warning: define `==` instead of `!=` to implement user defined comparison operator. it allows you to use `!=` automatically. [InvalidCmpOp]
|
|
'''
|
|
"""
|
|
|
|
# issue #25655
|
|
|
|
type Foo = distinct int
|
|
func `!=`(a, b: Foo): bool = int(a) != int(b)
|