mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
Added static types
I put this within the type section, but I'm not sure if it should go here. It has a broader use. Should it get its own section?
This commit is contained in:
@@ -878,6 +878,26 @@ AST:
|
||||
# ...
|
||||
)
|
||||
|
||||
Static types, like ``static[int]``, use ``nnkIdent`` wrapped in
|
||||
``nnkStaticTy``.
|
||||
|
||||
Concrete syntax:
|
||||
|
||||
.. code-block:: nim
|
||||
type A[T: static[int]] = object
|
||||
|
||||
AST:
|
||||
|
||||
.. code-block:: nim
|
||||
# ... within nnkGenericParams
|
||||
nnkIdentDefs(
|
||||
nnkIdent(!"T"),
|
||||
nnkStaticTy(
|
||||
nnkIdent(!"int")
|
||||
),
|
||||
nnkEmpty()
|
||||
)
|
||||
# ...
|
||||
|
||||
Procedure declaration
|
||||
---------------------
|
||||
|
||||
Reference in New Issue
Block a user