mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
- use `doAssert` in t17433 - use setGenericParamsMisc in semTemplateDef akin to semProcAux - pragma handling in semTemplateDef inline with semProcAux
17 lines
407 B
Nim
17 lines
407 B
Nim
# Inside template bodies, ensure return types referencing a param are replaced.
|
|
# This helps guarantee that return parameter analysis happens after argument
|
|
# analysis.
|
|
|
|
# bug #17433
|
|
|
|
from std/macros import expandMacros
|
|
|
|
proc bar(a: typedesc): a = default(a)
|
|
doAssert bar(float) == 0.0
|
|
doAssert bar(string) == ""
|
|
|
|
template main =
|
|
proc baz(a: typedesc): a = default(a)
|
|
doAssert baz(float) == 0.0
|
|
main()
|