This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
Tag Unitful v0.0.2 [https://github.com/ajkeller34/Unitful.jl] #6481
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have fixed a nasty promotion bug in v0.0.1 where
[1.0m, 2.0m] ./ 3
would throw aUnitful.DimensionError()
. I'm inclined to work on improving promotion—a few things still don't work quite like unitless numbers, for instance[1m, 2m]./3
will throw anInexactError()
—but I'll probably wait to fix that until JuliaLang/julia#18465 is patched so that I know which@inferred
errors are my fault when I play around withpromote_op
. Unitful v0.0.2 also adds a new unit conversion syntax.Is there a summary of the state of
promote_op
as of v0.5, as well as how to write code that is amenable to type inference? I'm sorry if that's a bit vague. I feel mypromote_op
functions could be simpler and better but I have tried writing them other ways and I get@inferred
failures. If I remove thepromote_op
definitions entirely then I get a lot of@inferred
failures, although I have some vague notion thatpromote_op
is being phased out... it's not even in the 0.5 manual anymore.