Return typeof(nil) (#12100)

* Allow typeof(nil) as a return type

* $typeof(nil) is now "typeof(nil)", not "nil"
This commit is contained in:
Andreas Rumpf 2019-08-31 19:24:44 +02:00 • committed by GitHub
commit 15213028b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View file

@ -12,4 +12,7 @@ proc f3(_: typedesc) = discard
f3(typeof(nil))
proc f4[T](_: T) = discard
f4(nil)
f4(nil)
proc f5(): typeof(nil) = nil
discard f5()