-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed forward in closure and added tests
- Loading branch information
Showing
19 changed files
with
267 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/tests/encore/forward/failedPolyTypeStreamWithObject.enc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
-- Error related to unknown _enc_type_t in method produce() | ||
-- read class Bar | ||
-- val v : int | ||
-- def init(v : int) : unit | ||
-- this.v = v | ||
-- end | ||
-- def getter() : int | ||
-- this.v | ||
-- end | ||
-- end | ||
active class Foo[t] | ||
stream produce(var n : int, v : t) : t | ||
while n>0 do | ||
yield(v) | ||
n -= 1 | ||
end | ||
end | ||
end | ||
active class Main | ||
def main() : unit | ||
val foo = new Foo[int] | ||
val s = foo!produce(10, 42) | ||
end | ||
end | ||
|
||
-- With the concrete type of stream, it works properly. | ||
{- | ||
read class Bar | ||
val v : int | ||
def init(v : int) : unit | ||
this.v = v | ||
end | ||
def getter() : int | ||
this.v | ||
end | ||
end | ||
active class Foo | ||
stream produce(var n : int) : Bar | ||
while n>0 do | ||
yield(new Bar(n)) | ||
n -= 1 | ||
end | ||
end | ||
end | ||
active class Main | ||
def printStream(var s : Stream[Bar]) : unit | ||
while not(eos(s)) do | ||
println("{}", (get(s)).getter()) | ||
s = getNext(s) | ||
end | ||
end | ||
def main() : unit | ||
val foo = new Foo | ||
val s = foo!produce(10) | ||
this.printStream(s) | ||
end | ||
end | ||
-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.