-
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.
Assigning from this turns the alias into a normal active reference
Note that getting a future from a method called on the alias will cause a deadlock!
- Loading branch information
Showing
3 changed files
with
44 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
class Foo | ||
def fr0b() : bool | ||
true | ||
|
||
def foo() : Fut bool | ||
let that = this in{ | ||
that.fr0b(); | ||
} | ||
|
||
def bar() : Fut bool | ||
let that = null : Foo in{ | ||
that = this; | ||
that.fr0b() | ||
} | ||
|
||
def baz() : Fut bool | ||
let id = \ (x : a) -> x | ||
that = id(this) | ||
in | ||
that.fr0b() | ||
|
||
class Main | ||
def main() : void | ||
let x = new Foo in{ | ||
assertTrue(get get x.foo()); | ||
assertTrue(get get x.bar()); | ||
assertTrue(get get x.baz()); | ||
print "Done!"; | ||
-- TODO: Find out why this is needed! | ||
embed void | ||
fflush(NULL); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Done! |