disable sink inference, only enable it for the stdlib. Reason: better source code compatibility (#15105)
This commit is contained in:
parent
e4e4931432
commit
86c9b78339
6 changed files with 18 additions and 5 deletions
|
|
@ -261,8 +261,14 @@ optimizations (and the current implementation does not).
|
|||
Sink parameter inference
|
||||
========================
|
||||
|
||||
The current implementation does a limited form of sink parameter
|
||||
inference. The `.nosinks`:idx: pragma can be used to disable this inference
|
||||
The current implementation can do a limited form of sink parameter
|
||||
inference. But it has to be enabled via `--sinkInference:on`, either
|
||||
on the command line or via a `push` pragma.
|
||||
|
||||
To enable it for a section of code, one can
|
||||
use `{.push sinkInference: on.}`...`{.pop.}`.
|
||||
|
||||
The `.nosinks`:idx: pragma can be used to disable this inference
|
||||
for a single routine:
|
||||
|
||||
.. code-block:: nim
|
||||
|
|
@ -270,8 +276,6 @@ for a single routine:
|
|||
proc addX(x: T; child: T) {.nosinks.} =
|
||||
x.s.add child
|
||||
|
||||
To disable it for a section of code, one can
|
||||
use `{.push sinkInference: off.}`...`{.pop.}`.
|
||||
|
||||
The details of the inference algorithm are currently undocumented.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue