typetraits: make genericHead docs reflect reality; use runnableExamples (#16776) [backport:1.4]
This commit is contained in:
parent
2d0cb18b9f
commit
8f1f0bd1da
2 changed files with 24 additions and 17 deletions
|
|
@ -282,7 +282,12 @@ block genericHead:
|
|||
doAssert not compiles(genericHead(Foo))
|
||||
type Bar = object
|
||||
doAssert not compiles(genericHead(Bar))
|
||||
# doAssert seq[int].genericHead is seq
|
||||
|
||||
when false: # xxx not supported yet
|
||||
doAssert seq[int].genericHead is seq
|
||||
when false: # xxx not supported yet, gives: Error: identifier expected
|
||||
type Hoo[T] = object
|
||||
doAssert genericHead(Hoo[int])[float] is Hoo[float]
|
||||
|
||||
block: # elementType
|
||||
iterator myiter(n: int): auto =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue