Add docs for nnkHiddenStdConv (#16408)
Add it to devel branch this time. I hope this works.
This commit is contained in:
parent
b57df6d0b3
commit
626c2bc658
1 changed files with 11 additions and 0 deletions
|
|
@ -1392,6 +1392,17 @@ Macro declaration
|
||||||
Macros behave like templates, but ``nnkTemplateDef`` is replaced with
|
Macros behave like templates, but ``nnkTemplateDef`` is replaced with
|
||||||
``nnkMacroDef``.
|
``nnkMacroDef``.
|
||||||
|
|
||||||
|
Hidden Standard Conversion
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. code-block:: nim
|
||||||
|
var f: float = 1
|
||||||
|
|
||||||
|
The type of "f" is ``float`` but the type of "1" is actually ``int``. Inserting
|
||||||
|
``int`` into a ``float`` is a type error. Nim inserts the ``nnkHiddenStdConv``
|
||||||
|
node around the ``nnkIntLit`` node so that the new node has the correct type of
|
||||||
|
``float``. This works for any auto converted nodes and makes the conversion
|
||||||
|
explicit.
|
||||||
|
|
||||||
Special node kinds
|
Special node kinds
|
||||||
==================
|
==================
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue