-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow already bound functions to be bound again.
This commit just disables the check. All of the real work was in previous commits that moved the target function into the bindings part of the closure that is tracked by the tydesc. Closes #754.
- Loading branch information
Showing
2 changed files
with
12 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,12 @@ | ||
// xfail-stage0 | ||
fn add(i: int, j: int) -> int { ret i + j; } | ||
fn binder(n: int) -> fn() -> int { | ||
let f = bind add(n, _); | ||
ret bind f(2); | ||
} | ||
fn main() { | ||
binder(5); | ||
let f = binder(1); | ||
assert(f() == 3); | ||
assert(binder(8)() == 10); | ||
} |