-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
implicit return lines reported active by coverage but not tracked in julia 1.10.2 #53557
Comments
(note: I forgot to remove the |
What was the latest version where this worke? 1.10.1, 1.9? |
Looks like all was OK on 1.9.3 and 1.9.4 (e.g. here on master: https://github.com/COBREXA/JSONFBCModels.jl/actions/runs/7223225523/job/19681839328 ). In this specific case I found on this merge request: COBREXA/JSONFBCModels.jl#8 and this pipeline: https://github.com/COBREXA/JSONFBCModels.jl/actions/runs/7875684795/job/22202840125 which is 1.10.2. I can try to bisect later, but I didn't have time to do much stuff lately so please don't count on me there 😅 |
adding the report from 1.9.3 just for completeness:
...anyway so the greet() not being reported at all is probably not a regression but I still wouldn't say it's optimal. |
Likely related to: #53354 |
I just hit this today. |
In other news, I'm getting several similar cases with functions that are easy to inline, such as: Base.:+(a::Int, b::Whatevs) = b+a
Base.:+(a::Whatevs, b::Int)= combine_whatevs_with_int(a,b) The first line never gets coverage; even calls to I somehow assume there's an over-zealous optimization somewhere in the way. |
Hello all,
I found that "implicit return" lines that contain only a variables are counted into lines that "should be covered" by tests but the coverage testing doesn't work on them.
For reproducers, I have a small package that only has this single source file:
and this
runtests.jl
file:The coverage produced by running
]test --coverage covtest
is as follows:This gets worked around by either adding explicit returns, or having a function called in the loops on the end (the explicit return can't be used there) -- e.g. as follows:
For the functions I assume the
return
there is adviseable, but for the implicit values ofbegin
/end
blocks this actually seems like a regression to me. I originally thought this is somehow triggered by switch to JuliaSyntax (I could not reproduce this on <1.10), but the same problem happens withJULIA_USE_FLISP_PARSER=1
so maybe not. I'd expect that this could be caused by some part of codegen optimistically assuming that "this won't generate any code!!" and just dropping the whole line, but I wasn't able to find any commit/change/sourcecode to blame there, so it might also be something entirely different.In case this is now the desired behavior, is there docs somewhere? (I just checked the release notes for 1.10 to be triple sure :D )
Thanks for any help/opinions on this :)
Best!
-mk
The text was updated successfully, but these errors were encountered: