Skip to content

Conversation

@LilithHafner
Copy link
Member

Fixes #51344
Bug introduced by #50105

@LilithHafner LilithHafner added docs This change adds or pertains to documentation bugfix This change fixes an existing bug labels Sep 16, 2023
end
function (la::Logged)(m::Module, s::Symbol)
m !== la.mod && !Base.ispublic(m, s) && push!(la.collection, m => s)
m !== la.mod && Base.isdefined(m, s) && !Base.ispublic(m, s) && push!(la.collection, m => s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not quite sure what the intent is with this code, but checking whether a value is defined seems like a code smell when everything else here is checking for properties of the binding.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to log any instances of "this global access will succeed but is not public". If isdefined is false, then we'll get an error (or an explicit note that the access is not defined) and there is no need for a warning. I think that Base.isdefined(m, s) && !Base.ispublic(m, s) is equivalent to the (not defined) Base.isprivate(m, s).

@LilithHafner LilithHafner added needs tests Unit tests are required for this change and removed needs tests Unit tests are required for this change labels Oct 24, 2023
@LilithHafner
Copy link
Member Author

Already had tests, lol

@LilithHafner LilithHafner merged commit a6d9df7 into master Oct 24, 2023
@LilithHafner LilithHafner deleted the lh/warn-nonpublic-fixup branch October 24, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug docs This change adds or pertains to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Help says "The following bindings may be internal" for non-existent names

3 participants