Shadowing warning on every command for function in +package directory

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Shadowing warning on every command for function in +package directory

Richard Crozier
Dear All,

I think I have noticed an issue with incorrectly warning about shadowing
of function in +package directories in the dev build (I am going to use
+package to refer to Matlab style package directories, as opposed to
Octave packages).

If I have a function in +package I get a shadowing warning against
functions of the same name in the global namespace. In recent builds
this is issued on every single command. I have done the following to
test this.

create a directory call +testpckg

Created a function file 'inverse.m' in this directory (there is an
Octave built-in inverse function). This new function should be in the
testpkg namespace and not clash with the built-in.

The directory containing +testpckg is added to the path on startup by
running genpath on a higher level directory. I have checked that the
directory +testpckg is not in the path, but the directory containing it is.

On startup I get the warning:

warning: function .../mfiles/octave-test/+testpckg/inverse.m shadows a
built-in function

This isn't so bad, but as I mentioned, I now also get the same warning
with every single command entered at the Octave prompt. On another
computer I have a build of Octave which displays the warning once on
startup only, so I think this behaviour has changed relatively recently
(within a few months).

hg id reports 63374982750b tip @

Is any of this known or should I submit a bug report? Can anyone else
reproduce it?

Regards,

Richard


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply | Threaded
Open this post in threaded view
|

Re: Shadowing warning on every command for function in +package directory

John W. Eaton
Administrator
Could you please report this on the bug tracker?  Problems reported
there are much less likely to be forgotten than they are if you post
them on the mailing list.

jwe

On 01/08/2016 04:34 AM, Richard Crozier wrote:

> Dear All,
>
> I think I have noticed an issue with incorrectly warning about shadowing
> of function in +package directories in the dev build (I am going to use
> +package to refer to Matlab style package directories, as opposed to
> Octave packages).
>
> If I have a function in +package I get a shadowing warning against
> functions of the same name in the global namespace. In recent builds
> this is issued on every single command. I have done the following to
> test this.
>
> create a directory call +testpckg
>
> Created a function file 'inverse.m' in this directory (there is an
> Octave built-in inverse function). This new function should be in the
> testpkg namespace and not clash with the built-in.
>
> The directory containing +testpckg is added to the path on startup by
> running genpath on a higher level directory. I have checked that the
> directory +testpckg is not in the path, but the directory containing it is.
>
> On startup I get the warning:
>
> warning: function .../mfiles/octave-test/+testpckg/inverse.m shadows a
> built-in function
>
> This isn't so bad, but as I mentioned, I now also get the same warning
> with every single command entered at the Octave prompt. On another
> computer I have a build of Octave which displays the warning once on
> startup only, so I think this behaviour has changed relatively recently
> (within a few months).
>
> hg id reports 63374982750b tip @
>
> Is any of this known or should I submit a bug report? Can anyone else
> reproduce it?
>
> Regards,
>
> Richard
>
>