| 1 |
probe process("inherit.exe").function("main") |
| 2 |
{ |
| 3 |
// A::foo is masked, so @cast is necessary. |
| 4 |
println(@cast(&$b, "A")->foo->x) |
| 5 |
println(@cast(&$b, "A")->foo->y) |
| 6 |
|
| 7 |
// A::bar is not masked, so inheritance should find it. |
| 8 |
println($b->bar->x) |
| 9 |
println($b->bar->y) |
| 10 |
|
| 11 |
// B::foo masks A::foo, so should be found first. |
| 12 |
// NB: We can't treat a struct as a scalar, so this will fail if it |
| 13 |
// tries to go through A::foo. B::foo should be fine as an int. |
| 14 |
println($b->foo) |
| 15 |
|
| 16 |
// Pretty-printing should skip the masked A::foo altogether |
| 17 |
println($b$) |
| 18 |
println($b$$) |
| 19 |
} |