Allow typeof(nil) as generic parameter (#11869)
This commit is contained in:
parent
50e921bb94
commit
bcfb540e57
2 changed files with 11 additions and 4 deletions
|
|
@ -2,5 +2,14 @@ discard """
|
|||
targets: "c cpp"
|
||||
"""
|
||||
|
||||
proc foo(v: type(nil)) = discard
|
||||
foo nil
|
||||
proc f1(v: typeof(nil)) = discard
|
||||
f1(nil)
|
||||
|
||||
proc f2[T]() = discard
|
||||
f2[typeof(nil)]()
|
||||
|
||||
proc f3(_: typedesc) = discard
|
||||
f3(typeof(nil))
|
||||
|
||||
proc f4[T](_: T) = discard
|
||||
f4(nil)
|
||||
Loading…
Add table
Add a link
Reference in a new issue