summary refs log tree commit diff stats
path: root/tests/generics/tgenerictmpl2.nim
Commit message (Collapse)AuthorAgeFilesLines
* adopt testsArne Döring2018-11-081-1/+1
|
* Remove expr/stmt (#5857)Arne Döring2017-07-251-1/+1
|
* fixes #3496Adam Strzelecki2015-10-291-0/+31
The problem comes from the fact that macroOrTmpl[...] is transformed by semSubscript which is trying to evaluate macroOrTmpl identifier in place. This is okay for non-generic macros or templates, but wrong for generic ones, that do not have a chance to receive their generic arguments explicitly specified in brackets. Solution: 1. macroOrTmpl[...] where macroOrTmpl is non-generic macro or template, then macroOrTmpl is evaluated before applying brackets. (as before) 2. macroOrTmpl[...] where macroOrTmpl is generic macro or template, then if: a. It comes from macroOrTmpl[...](...) call expr (efInCall), then macroOrTmpl is turned into a symbol (efNoEvaluate) rather than evaluating it in place, then whole bracket expr is returned to semIndirectOp which transforms it to proper generic macro or template call with explicit generic arguments. b. macroOrTmpl[...] does not come from call expr, as above macroOrTmpl is transformed to symbol, then it is transformed into proper generic macro or template call with explicit generic arguments and no normal arguments.