Open markspanbroek opened 3 years ago
Wait, but why would you want to include this file in your user code?
And the underlying problem with closures with sink inference is known and that's why sink inference is disabled for user code
oh, in your case it causes issues with exception tracking because of the pop, interesting
but yeah, anyway, I don't see how inclrtl is used in the asyncloop.nim file
The file was included in chronos because it started out as a copy of async from the standard library. Now that we've found the root cause, we're indeed likely to remove the include.
@markspanbroek yeah, just remove that line - chronos doesn't use it at all, it's only needed for making RTL procs. I tested and chronos compiles just fine with that line removed
Notably this is a regression from nim 1.2 where there is no push
in inclrtl
- the include
itself is a leftover from past times that we'll remove but we're opening the issue to highlight the regression itself and a general problem with push
inside files that are designed for including.
@arnetheduck sure, but then this issue should have a more generic title about push pragma in include'd files :)
system/inclrtl
pushes sinkInference, which can lead to unexpected results when you're working with exception tracking using{.push raises:[...].}
statements.This confusion is the root cause of https://github.com/status-im/nim-chronos/issues/169.
Example
The
{.pop.}
in the example does not pop theraises
pragma as you might expect, but thesinkInference
pragma instead.Current Output
Expected Output
No errors
Additional Information