diff --git a/src/metamodel/ClassHOW.pir b/src/metamodel/ClassHOW.pir index 82523f50863..7857f9e4fa4 100644 --- a/src/metamodel/ClassHOW.pir +++ b/src/metamodel/ClassHOW.pir @@ -57,6 +57,7 @@ calls on it. addattribute $P0, '$!done' addattribute $P0, '$!ver' addattribute $P0, '$!auth' + addattribute $P0, '$!handles_dispatchers' # Create proto-object for it. classhowproto = p6meta.'register'($P0) @@ -165,6 +166,30 @@ Add an attribute. .end +=item add_handles_fallback + +=cut + +.sub 'add_handles_fallback' :method + .param pmc obj + .param pmc attrname + .param pmc matcher + + # Create info hash. + $P0 = root_new ['parrot';'Hash'] + $P0['attrname'] = attrname + $P0['match_against'] = matcher + + # Add to list, vivifying if needed. + $P1 = getattribute self, '$!handles_dispatchers' + unless null $P1 goto have_list + $P1 = root_new ['parrot';'ResizablePMCArray'] + setattribute self, '$!handles_dispatchers', $P1 + have_list: + push $P1, $P0 +.end + + =item attributes() Gets the attributes that the class declares, returning a list of