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

Adress some more JET warnings #1709

Merged
merged 1 commit into from
May 17, 2024
Merged

Adress some more JET warnings #1709

merged 1 commit into from
May 17, 2024

Conversation

lgoettgens
Copy link
Collaborator

No description provided.

@lgoettgens lgoettgens requested a review from fingolfin May 16, 2024 16:39
@@ -552,8 +552,8 @@ end
#
################################################################################

mutable struct printer
io::IO
mutable struct printer{IOT <: IO}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This makes all functions using this printer thing type-stable (as they eventually access the underlying IO)

return a([one(base_ring(a))], reshape([[UInt(j == n - i + 1)
for j in 1:n]..., UInt(1)], n + 1, 1))
return a([one(base_ring(a))], reshape(UInt[(UInt(j == n - i + 1)
for j in 1:n)..., UInt(1)], n + 1, 1))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The input of reshape got inferred as Vector{Any}. This additional type annot helps. And additionally, I got rid of some allocations by not creating the inner vector.

@@ -24,7 +24,7 @@ function is_exact_type(::Type{T}) where {S <: RingElement, U <: MPolyRingElem{S}
return is_exact_type(S)
end

parent(p::UnivPoly) = p.parent
parent(p::UnivPoly) = p.parent::parent_type(p)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

somehow julia couldn't infer p.parent properly, the second type param (the MPolyRing) abstract. Additionally use this accessor everywhere in this file instead of direct access

@lgoettgens
Copy link
Collaborator Author

Furthermore, there is some issue with deepcopy(::::ResElem), but that is due to some julia issue. See JuliaLang/julia#54496

Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.32%. Comparing base (a2e601d) to head (b1b7079).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1709   +/-   ##
=======================================
  Coverage   87.32%   87.32%           
=======================================
  Files         117      117           
  Lines       29824    29824           
=======================================
  Hits        26045    26045           
  Misses       3779     3779           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thofma thofma merged commit 8a5e06f into Nemocas:master May 17, 2024
31 checks passed
@lgoettgens lgoettgens deleted the lg/JET branch May 22, 2024 09:51
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.

None yet

3 participants