Ambiguity between local access and global define
Posted: Tue Jul 16, 2024 3:07 pm
Hi,
we've troubleshoot some of our ported code today and found out we had an ambiguous variable access between a local access and a global define.
The Global define is not even part of the current project but from another projected referenced in the solution
We've disabled the implicit namespace compiler option.
here are the culprits :
in project1.class1
in project2, global :
In our case we were having a STACKOVERFLOW crash as the access would go into an infinite loop.
So now we prefix the LocFacComLib.Functions.STATUT_CTRL to get the global define to lift the ambiguity.
How could we further prevent this ?
Can't the compiler warn us, like it does for other ambigous calls ?
Regards.
we've troubleshoot some of our ported code today and found out we had an ambiguous variable access between a local access and a global define.
The Global define is not even part of the current project but from another projected referenced in the solution
We've disabled the implicit namespace compiler option.
here are the culprits :
in project1.class1
Code: Select all
CLASS LocDetArray
ACCESS STATUT_CTRL()
RETURN ( SELF:FIELDGET( #STATUT ) = STATUT_CTRL )
END CLASS
Code: Select all
DEFINE STATUT_CTRL := "4"
So now we prefix the LocFacComLib.Functions.STATUT_CTRL to get the global define to lift the ambiguity.
How could we further prevent this ?
Can't the compiler warn us, like it does for other ambigous calls ?
Regards.