The next several questions concern this code:
asset class Money {…}
asset class Bank {
owned Money myMoney;
void depositMoney(owned Money >> unowned Money deposit) { … }
owned Money withdrawMoney() {…} // Withdraws all money
}
class Test {
Bank b;
void putMoneyInBank(owned Money >> unowned Money m) {
// At the beginning of this method, m owns an instance of Money.
owned Money q = m; // Location (A)
b.depositMoney(q); // Location (B)
// Location (C)
b.depositMoney(b.withdrawMoney()) // Location (D)
}
}
At the beginning of putMoneyInBank()
, what is the type of m
?