fixes output stream casting problem
This commit is contained in:
parent
12250ec3ed
commit
e7a34b74f2
2 changed files with 15 additions and 2 deletions
|
|
@ -6,7 +6,9 @@ type
|
|||
buffer: string
|
||||
startOffset: int
|
||||
|
||||
OutputStream* = object
|
||||
# somehow casting outputDevice to
|
||||
# OutputStreamVar requires RootObj
|
||||
OutputStream* = object of RootObj
|
||||
cursor*: WriteCursor
|
||||
pages: Deque[OutputPage]
|
||||
endPos: int
|
||||
|
|
|
|||
|
|
@ -150,3 +150,14 @@ suite "output stream":
|
|||
# The final outputs are the same
|
||||
check altOutput == memStream.getOutput
|
||||
|
||||
test "nim odd behavior":
|
||||
# discovered in status-im/nim-snappy#2
|
||||
proc encode(s: OutputStreamVar) =
|
||||
check true
|
||||
|
||||
proc abc(s: OutputStreamVar) =
|
||||
OutputStreamVar(s.outputDevice).encode
|
||||
check true
|
||||
|
||||
var os = new OutputStream
|
||||
os.abc()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue