role stub workaround fails for parameterized roles
[email protected] (John Macdonald) Mon, 9 Apr 2018 19:05:02 +0000
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <[email protected]> |
--_000_8f2ad6d32853458da49ba4d7af93bd2boicronca_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
There is a problem described for roles, where an attribute defined by one r=
ole is used in another. The workaround given is to have the parent define =
a stub method with "sub METHOD {}"
This doesn't work for MooseX::Role::Parameterized roles. In this case, eve=
n
with the stub declred, there is still the error: Attribute (ATTR) of class=
CLASS has no associated methods (did you mean to provide an "is" argument?=
)
I presume that this is related to the requirement in parameterized roles th=
at method cannot be declare as sub's but must be declared using the "method=
" keyword.
Is there a way to declare a stub method for parameterized roles?
John Macdonald
Software Engineer
Ontario Institute for Cancer Research
MaRS Centre
661 University Avenue
Suite 510
Toronto, Ontario
Canada M5G 0A3
Tel:
Email: [email protected]
Toll-free: 1-866-678-6427
Twitter: @OICR_news
www.oicr.on.ca<http://www.oicr.on.ca/>
This message and any attachments may contain confidential and/or privileged=
information for the sole use of the intended recipient. Any review or dist=
ribution by anyone other than the person for whom it was originally intende=
d is strictly prohibited. If you have received this message in error, pleas=
e contact the sender and delete all copies. Opinions, conclusions or other =
information contained in this message may not be that of the organization.
--_000_8f2ad6d32853458da49ba4d7af93bd2boicronca_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"><!-- P {margin-top:0;margi=
n-bottom:0;} --></style>
</head>
<body dir=3D"ltr">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt;color:#000000;font=
-family:Calibri,Arial,Helvetica,sans-serif;">
<p>There is a problem described for roles, where an attribute defined by on=
e role is used in another. The workaround given is to have the parent=
define a stub method with "sub METHOD {}"</p>
<p><br>
</p>
<p>This doesn't work for <span>MooseX::Role::Parameterized</span> roles.&nb=
sp; In this case, even</p>
<p>with the stub declred, there is still the error: <span>Attribute (=
ATTR) of class CLASS has no associated methods (did you mean to provide an =
"is" argument?)</span></p>
<p><span><br>
</span></p>
<p><span>I presume that this is related to the requirement in parameterized=
roles that method cannot be declare as sub's but must be declared using th=
e "method" keyword.</span></p>
<p><span><br>
</span></p>
<p><span>Is there a way to declare a stub method for parameterized ro=
les?</span><br>
</p>
<p><br>
</p>
<div id=3D"Signature">
<div style=3D"font-family:Tahoma; font-size:13px">
<p class=3D"western" style=3D"margin-bottom:0cm"><font color=3D"#39793b"><f=
ont style=3D"font-size:9pt" size=3D"2"><span lang=3D"en-US"><b>John Macdona=
ld</b></span></font></font><font color=3D"#39793b"><font style=3D"font-size=
:9pt" size=3D"2"><b><br>
</b></font></font><font style=3D"font-size:8pt" size=3D"1"><span lang=3D"en=
-US">Software Engineer<br>
<br>
</span></font><font color=3D"#39793b"><font style=3D"font-size:9pt" size=3D=
"2"><b>Ontario Institute for Cancer Research</b></font></font><font color=
=3D"#39793b"><font style=3D"font-size:8pt" size=3D"1"><br>
</font></font><font style=3D"font-size:8pt" size=3D"1">MaRS Centre</font></=
p>
<p class=3D"western" style=3D"margin-bottom:0cm"><font style=3D"font-size:8=
pt" size=3D"1">661 University Avenue</font></p>
<p class=3D"western" style=3D"margin-bottom:0cm"><font style=3D"font-size:8=
pt" size=3D"1">Suite 510
<br>
Toronto, Ontario </font></p>
<p class=3D"western" style=3D"margin-bottom:0cm"><font style=3D"font-size:8=
pt" size=3D"1">Canada M5G 0A3</font><font style=3D"font-size:8pt" size=
=3D"1"><span lang=3D"en-US"><br>
</span></font><br>
</p>
<p class=3D"western" style=3D"margin-bottom:0cm"><font style=3D"font-size:8=
pt" size=3D"1"><span lang=3D"en-US">Tel:
</span></font></p>
<p class=3D"western" style=3D"margin-bottom:0cm"><font style=3D"font-size:8=
pt" size=3D"1"><span lang=3D"en-US">Email: [email protected]</span>=
</font></p>
<p class=3D"western" style=3D"margin-bottom:0cm"><font style=3D"font-size:8=
pt" size=3D"1">Toll-free: 1-866-678-6427</font><font style=3D"font-size:8pt=
" size=3D"1"><span lang=3D"en-US"><br>
</span></font><font style=3D"font-size:8pt" size=3D"1">Twitter: @OICR_news<=
/font></p>
<p class=3D"western" style=3D"margin-bottom:0cm"><br>
</p>
<p class=3D"western" style=3D"margin-bottom:0cm"><font color=3D"#0000ff"><u=
><a class=3D"western" href=3D"http://www.oicr.on.ca/" id=3D"LPNoLP"><font s=
tyle=3D"font-size:8pt" size=3D"1">www.oicr.on.ca</font></a></u></font><font=
style=3D"font-size:8pt" size=3D"1"><span lang=3D"en-US"><br>
<br>
</span></font><font color=3D"#000000"><font face=3D"Arial, sans-serif"><fon=
t style=3D"font-size:8pt" size=3D"1">This message and any attachments may c=
ontain confidential and/or privileged information for the sole use of the i=
ntended recipient. Any review or distribution
by anyone other than the person for whom it was originally intended is str=
ictly prohibited. If you have received this message in error, please contac=
t the sender and delete all copies. Opinions, conclusions or other informat=
ion contained in this message may
not be that of the organization.</font></font></font></p>
</div>
</div>
</div>
</body>
</html>
--_000_8f2ad6d32853458da49ba4d7af93bd2boicronca_--