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

Redesign the HashType handling for better inference #1969

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented Aug 18, 2020

Encoding the HashType as a keyword argument tends to cause inference to lose any type parameters due to JuliaLang/julia#36454 and its interaction with NamedTuple. Making it a positional argument fixes this problem.

@@ -2294,7 +2294,7 @@ end
end
end

tree_hash(root::AbstractString) = bytes2hex(Pkg.GitTools.tree_hash(root))
tree_hash(root::AbstractString) = bytes2hex(@inferred Pkg.GitTools.tree_hash(root))
Copy link
Sponsor Member

@KristofferC KristofferC Aug 19, 2020

Choose a reason for hiding this comment

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

Perhaps just making a separate test to test that it infers is slightly better than calling @inferred over and over (many times with the same argument). Doesn't really matter though.

@KristofferC KristofferC merged commit 60bda8c into master Aug 19, 2020
@KristofferC KristofferC deleted the teh/hash_types branch August 19, 2020 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants