fix #6108
This commit is contained in:
parent
765116d547
commit
70380882c5
2 changed files with 21 additions and 5 deletions
13
tests/concepts/tcomparable.nim
Normal file
13
tests/concepts/tcomparable.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
type
|
||||
Comparable = concept a
|
||||
(a < a) is bool
|
||||
|
||||
proc myMax(a, b: Comparable): Comparable =
|
||||
if a < b:
|
||||
return b
|
||||
else:
|
||||
return a
|
||||
|
||||
doAssert myMax(5, 10) == 10
|
||||
doAssert myMax(31.3, 1.23124) == 31.3
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue