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

Fix some incorrect piracy flagging #131

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

fingolfin
Copy link
Member

If the type of a method argument is a union, then if any of the types in the union is foreign, the whole type should count as foreign.

But when installing a method for a union, then it should only count as foreign if all the types in the union are foreign.

Resolves #114

@codecov
Copy link

codecov bot commented Jun 4, 2023

Codecov Report

Merging #131 (1079abf) into master (7c6d65b) will increase coverage by 0.17%.
The diff coverage is 84.61%.

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   75.17%   75.34%   +0.17%     
==========================================
  Files          11       11              
  Lines         705      718      +13     
==========================================
+ Hits          530      541      +11     
- Misses        175      177       +2     
Flag Coverage Δ
unittests 75.34% <84.61%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/piracy.jl 91.42% <84.61%> (-1.56%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

If the type of a method *argument* is a union, then if *any* of the
types in the union is foreign, the whole type should count as
foreign.

But when installing a method for a union, then it should only count
as foreign if *all* the types in the union are foreign.
@fingolfin fingolfin force-pushed the mh/piracy-reporting branch from 169b8c0 to 1079abf Compare June 4, 2023 19:56
@fingolfin fingolfin merged commit 6846ac1 into JuliaTesting:master Jun 5, 2023
@fingolfin fingolfin deleted the mh/piracy-reporting branch June 5, 2023 07:50
Comment on lines +154 to 156
is_foreign_method(signature.parameters[1], method_pkg) || return false

all(param -> is_foreign(param, method_pkg), signature.parameters)
Copy link
Collaborator

Choose a reason for hiding this comment

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

As the first entry of signature.parameters is handled differently, the is_foreign check should only be applied to signature.parameters[2:end], right?

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

Successfully merging this pull request may close these issues.

Incorrect (?) type piracy report
2 participants