Re: Doxygen confused between a member method and a local variable which have the same name

Ron W <[email protected]> Tue, 30 Aug 2022 10:35:31 -0400
Newsgroups gmane.text.doxygen.general
Message-ID <CAHWyCX4fC2T+UnfPwdG9s5XeF7gfu3-GD3MRi6k9cO7DsHvprQ@mail.gmail.com>
--===============5322271392981534903==
Content-Type: multipart/alternative; boundary="00000000000078f3cb05e7764be0"

--00000000000078f3cb05e7764be0
Content-Type: text/plain; charset="UTF-8"

On Mon, Aug 29, 2022 at 7:04 AM <[email protected]>
wrote:

> Date: Mon, 29 Aug 2022 10:45:22 +0000
> From: ericruan(???) <[email protected]>
> Subject: [Doxygen-users] Doxygen confused between a member method and
>         a local variable which have the same name
>
[...]

> The class graphs seems okay but there is a mistake in called by graph. In
> onStart method it has a reference to start which should be detected as a
> reference to the local variable start but doxygen detected it as a
> reference to a method named start which is a member method to it?s
> superclass. Is this a bug of doxygen or it?s some setting that can cause it?
>

It might be a design limitation of Doxygen. Even in languages that allow a
symbol with local scope to override a symbol in a surrounding scope, it is
not good practice to do so.

If you are documenting legacy code, is the onStart method only
referencing the local variable, or is it also referencing the super-class'
start method?

If only referencing the local variable, then a simple filter script could
add a prefix or suffix to the variable name.

If referencing both, a filter would need to discriminate between a variable
access and a method call. Presumably the compiler already does this.

--00000000000078f3cb05e7764be0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Mon, Aug 29, 2022 at 7:04 AM &lt;<a hr=
ef=3D"mailto:[email protected]">doxygen-users-req=
[email protected]</a>&gt; wrote:<br></div><div class=3D"gmail_quot=
e"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex">Date: Mon, 29 Aug 2022=
 10:45:22 +0000<br>
From: ericruan(???) &lt;<a href=3D"mailto:[email protected]" target=3D"_b=
lank">[email protected]</a>&gt;<br>
Subject: [Doxygen-users] Doxygen confused between a member method and<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 a local variable which have the same name<br></=
blockquote><div>[...]=C2=A0</div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">
The class graphs seems okay but there is a mistake in called by graph. In o=
nStart method it has a reference to start which should be detected as a ref=
erence to the local variable start but doxygen detected it as a reference t=
o a method named start which is a member method to it?s superclass. Is this=
 a bug of doxygen or it?s some setting that can cause it?<br></blockquote><=
div><br></div><div>It might be a design limitation of Doxygen. Even in lang=
uages that allow a symbol with local scope to override a symbol in a surrou=
nding scope, it is not good practice to do so.</div><div><br></div><div>If =
you are documenting legacy code, is the onStart method only referencing=C2=
=A0the local variable, or is it also referencing the super-class&#39; start=
 method?</div><div><br></div><div>If only referencing the local variable, t=
hen a simple filter script could add a prefix or suffix to the variable nam=
e.</div><div><br></div><div>If referencing both, a filter would need to dis=
criminate=C2=A0between a variable access and a method call. Presumably the =
compiler already does this.</div><div><br></div></div></div>

--00000000000078f3cb05e7764be0--


--===============5322271392981534903==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============5322271392981534903==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Doxygen-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doxygen-users

--===============5322271392981534903==--