mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-15 08:03:46 +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_op1.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)
|