FWIW, the problem was that I was doing this:
self.declarator := '' ~ $name;when, as anyone can plainly see, I should have been doing this:
self.declarator('' ~ $name);because .declarator is a method, not an attribute. D'oh.
I've seen this error once before, and I didn't remember what caused it. I hope that next time I'll remember it, or that The All-Knowing Oz will be able to remind me.