Course of Raku / Objects, I/O, and exceptions / Classes and objects / Roles / Adding a role to an object
Quiz — Roles
What does the following program print?
role Flyer {
method fly { 'up we go' }
}
class Bird does Flyer {
}
say Bird.new.fly;| 0 | Flyer |
| 1 | up we go |
| 0 | True |
| 0 | an error |