blob: 5b73aaf78afc17ef9ca111425acac72c8c4e9d5e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
references(&int a, &int b, () r)
{
/* don't have assignment and not quite sure if I want to have to
* dereference references so I guess we can't really do much here at the
* moment, heh */
r();
}
main()
{
20 => int twenty;
30 => int thirty;
references(twenty&, thirty&) => {
20 + 30 => int fifty; /* ok */
};
/* references are not active anymore so we can reference again */
references(twenty&, thirty&) => {
/* Try uncommenting!
* Not ok since twenty/thirty is actively borrowed
*/
// twenty + thirty => int fifty;
};
}
|