Skip to content

Commit

Permalink
Decay Array iso references to Array ref before calling box methods.
Browse files Browse the repository at this point in the history
This is a workaround for ponylang#1887
  • Loading branch information
plietar committed May 4, 2017
1 parent 8ab2937 commit 14844f0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/buffered/_test.pony
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class iso _TestWriter is UnitTest
[as U8: '\n'; 't'; 'h'; 'e']
[as U8: 'r'; 'e'; '\r'; '\n']] end)

for bs in wb.done().values() do
let wb' : Array[(String val | Array[U8 val] val)] ref = wb.done()
for bs in wb'.values() do
try
b.append(bs as Array[U8] val)
end
Expand Down
3 changes: 2 additions & 1 deletion packages/files/directory.pony
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ class Directory
if fi.directory and not fi.symlink then
let directory = open(target)

for entry in directory.entries().values() do
let dir_entries : Array[String] ref = directory.entries()
for entry in dir_entries.values() do
if not directory.remove(entry) then
return false
end
Expand Down
3 changes: 2 additions & 1 deletion packages/files/file_path.pony
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ class val FilePath
if info.directory and not info.symlink then
let directory = Directory(this)

for entry in directory.entries().values() do
let entries : Array[String] ref = directory.entries()
for entry in entries.values() do
if not join(entry).remove() then
return false
end
Expand Down
3 changes: 2 additions & 1 deletion packages/term/ansi_term.pony
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ actor ANSITerm
return
end

for c in (consume data).values() do
let data' : Array[U8] ref = consume data
for c in data'.values() do
match _escape
| _EscapeNone =>
if c == 0x1B then
Expand Down

0 comments on commit 14844f0

Please sign in to comment.