You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
streams from the standard library fails to compile when compiling with taint mode enabled.
Example
import streams
Then compile with --taintMode:on
Current Output
Compilation fails with the following:
/mnt/c/Users/Sam/Documents/Nim/lib/pure/streams.nim(904, 11) Error: type mismatch: got <TaintedString, int literal(0)>
but expected one of:
proc setLen[T](s: var seq[T]; newlen: Natural)
first type mismatch at position: 1
required type for s: var seq[T]
but expression 'line' is of type: TaintedString
proc setLen(s: var string; newlen: Natural)
first type mismatch at position: 1
required type for s: var string
but expression 'line' is of type: TaintedString
Expected Output
(should compile successfully)
Possible Solution
Going to the line of code in the error message reveals:
streams
from the standard library fails to compile when compiling with taint mode enabled.Example
import streams
Then compile with
--taintMode:on
Current Output
Compilation fails with the following:
Expected Output
(should compile successfully)
Possible Solution
Going to the line of code in the error message reveals:
The easiest solution may be to borrow
setLen
(andadd
, which is used later instreams
) fromstring
.Additional Information
streams
instead ofhttpclient
(in fact, I encountered this when trying to reproduce that issue)The text was updated successfully, but these errors were encountered: