borrowed procs can have a body now for documentation generation (#20617)
* borrowed procs can have a body now * fixes examples
This commit is contained in:
parent
008c3ec76a
commit
98b2838a30
2 changed files with 20 additions and 3 deletions
|
|
@ -29,4 +29,20 @@ baz.doThing()
|
|||
|
||||
assert $seq[int](foo) == $foo
|
||||
assert $seq[int](bar) == $bar
|
||||
assert $seq[int](baz) == $baz
|
||||
assert $seq[int](baz) == $baz
|
||||
|
||||
type
|
||||
Fine* = distinct string
|
||||
|
||||
proc `==`*(x, y: Fine): bool {.borrow.} =
|
||||
## Here is the documentation
|
||||
runnableExamples:
|
||||
var x = Fine("1234")
|
||||
var y = Fine("1234")
|
||||
doAssert x == y
|
||||
doAssert false
|
||||
|
||||
|
||||
var x = Fine("1234")
|
||||
var y = Fine("1234")
|
||||
doAssert x == y
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue