Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"undefined reference" error in test_piracy #167

Closed
dhanak opened this issue Aug 25, 2023 · 3 comments
Closed

"undefined reference" error in test_piracy #167

dhanak opened this issue Aug 25, 2023 · 3 comments

Comments

@dhanak
Copy link

dhanak commented Aug 25, 2023

Version 0.6.4 introduced an issue with test_piracy, which can be reproduced with the following minimal working example:

julia> module M
           struct S <: Function
               i::Int
           end
       end

julia> using Aqua; Aqua.test_piracy(M)
ERROR: UndefRefError: access to undefined reference

The problem is that even though S is a Function, S.instance doesn't exist. I guess the latter makes sense, since S can only be instantiated with a specific integer parameter, it doesn't have a “default” instance.

@lgoettgens
Copy link
Collaborator

Note that this is an issue only on the 0.6.x versions, on master/0.7-DEV this is already fixed. A small fix for 0.6.x is #170.

Furthermore, please note that there is no support to use your own subtypes of Function in treat_as_own. If you would like to have that feature, this should be added as a new issue. Optimally, this should then include some conceptual idea to implement it or at least the input format for treat_as_own.

@fingolfin
Copy link
Collaborator

@dhanak can you confirm this works in 0.7?

@fingolfin fingolfin reopened this Sep 5, 2023
@dhanak
Copy link
Author

dhanak commented Sep 5, 2023

I just checked and it seems to be working as expected. The test that failed on my package succeeds with 0.7. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants