diff options
author | Zahary Karadjov <zahary@gmail.com> | 2012-03-29 16:03:51 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2012-03-31 18:50:48 +0300 |
commit | 22dc76a361c70af93403dfbf2610c8d49111637c (patch) | |
tree | e04bfd670534fa2bbd8924746cba656da00fde66 /compiler/transf.nim | |
parent | 6216046bc6b2794d15705f5d2621f602bda636c4 (diff) | |
download | Nim-22dc76a361c70af93403dfbf2610c8d49111637c.tar.gz |
typedesc and expr params
types are now valid proc/template/macro params and you can overload over them: proc foo(T: typedesc) # accept any type proc foo(T: typedesc{int}) # overload specifically for int proc foo(T: typedesc{int or float or Callable}) # overload for any type matching the constraints expr{type} is a param expecting compile time value of the designated type (or type class). when typedesc or expr params are used with a proc, the proc will be instantiated once for each unique type/value used as parameter.
Diffstat (limited to 'compiler/transf.nim')
0 files changed, 0 insertions, 0 deletions