Expanded the typeinfo module's doc comment to warn that rtti will evolve and suggest alternative approaches. (#10596)

This commit is contained in:
Dean Thompson 2019-02-10 02:56:28 -05:00 • committed by Andreas Rumpf
commit f785286743

View file

@ -8,12 +8,19 @@
# #
## This module implements an interface to Nim's `runtime type information`:idx: ## This module implements an interface to Nim's `runtime type information`:idx:
## (`RTTI`:idx:). ## (`RTTI`:idx:). See the `marshal <marshal.html>`_ module for an example of
## Note that even though ``Any`` and its operations hide the nasty low level ## what this module allows you to do.
## details from its clients, it remains inherently unsafe!
## ##
## See the `marshal <marshal.html>`_ module for what this module allows you ## Note that even though ``Any`` and its operations hide the nasty low level
## to do. ## details from its clients, it remains inherently unsafe! Also, Nim's
## runtime type information will evolve and may eventually be deprecated.
## As an alternative approach to programmatically understanding and
## manipulating types, consider using the `macros <macros.html>`_ package to
## work with the types' AST representation at compile time. See, for example,
## the `getTypeImpl proc<macros.html#getTypeImpl,NimNode>`_. As an alternative
## approach to storing arbitrary types at runtime, consider using generics.
##
##
{.push hints: off.} {.push hints: off.}