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
{.experimental: "views".}
typeReader=object
data: openArray[char]
current: intprocinitReader(data: openArray[char], offset =0): Reader=whendefined(bad):
result=Reader(data: data, current: offset)
whendefined(good):
result.data = data
result.current = offset
let s ="\x01\x00\x00\x00"echoinitReader(s).data[0].int
Current Output -d:good
1
Current Output -d:bad
....CC: bug2.nim
/home/jfondren/.cache/nim/bug2_d/@mbug2.nim.c: In function ‘initReader__UYdi27TUMFesBFKaWXlJFQ’:
/home/jfondren/.cache/nim/bug2_d/@mbug2.nim.c:346:16: error: incompatible types when assigning to type ‘tyOpenArray__g7UvpSI7wiag75QHJKQ1sQ’ from type ‘NIM_CHAR *’ {aka ‘char *’}
346 | result.data = data;
| ^~~~
Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -I/home/jfondren/.choosenim/toolchains/nim-1.4.0/lib -I/home/jfondren/nim/bugs -o /home/jfondren/.cache/nim/bug2_d/@mbug2.nim.c.o /home/jfondren/.cache/nim/bug2_d/@mbug2.nim.c' failed with exit code: 1
Additional Information
$ nim -v
Nim Compiler Version 1.4.0 [Linux: amd64]
Compiled at 2020-10-16
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: bdcd87afca238a0a7b2c70971827cf9172817b12
active boot switches: -d:release
The text was updated successfully, but these errors were encountered:
Example
Current Output -d:good
Current Output -d:bad
Additional Information
The text was updated successfully, but these errors were encountered: