subtype OddInt of Int where { $^n % 2 == 1 } has OddInt $.foo is rw; # And then: $obj.foo = 12; # will die (at compile-time!)