Adding a test case to make sure spawning polymorphic functions works.
This commit is contained in:
parent
230a5869b4
commit
45cac8a95f
1 changed files with 12 additions and 0 deletions
|
@ -64,3 +64,15 @@ fn test_join_convenient() {
|
|||
let handle = task::spawn_joinable(f);
|
||||
assert (task::tr_success == task::join(handle));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn spawn_polymorphic() {
|
||||
fn foo<~T>(x : -T) {
|
||||
log_err x;
|
||||
}
|
||||
|
||||
let fb = bind foo(true);
|
||||
|
||||
task::spawn(fb);
|
||||
task::spawn(bind foo(42));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue