stevan / p5-MOP

A Meta Object Protocol for Perl 5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check integrity of the %HAS variable

stevan opened this issue · comments

(From #14 by @wolfsage)

You can specify a non-sub for @Has attributes:

@HAS = ( x => {} ),

This will crash at runtime with a not-a-code-reference. Would it be possible/better to do this check at compile time (unitcheck?) when finalizing the class to make sure attributes are properly formed?