Reland Typeassert, with convert on construct#10
Conversation
|
Note that three tests were changed, updated to the form @test c.k === convert(Complex{Real}, 10 + 10im)This is because the We have julia> 1 + 2im isa Complex{Real}
falseso naturally, we shouldn't actually be able to store a The goal is to emulate Julia's types more closely (principle of least surprise?). julia> struct MyStruct
x::Complex{Real}
end
julia> MyStruct(1 + 2im).x === 1 + 2im
false
julia> MyStruct(1 + 2im).x === convert(Complex{Real}, 1 + 2im)
trueWith this PR, |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #10 +/- ##
==========================================
+ Coverage 94.40% 94.45% +0.05%
==========================================
Files 3 3
Lines 393 397 +4
==========================================
+ Hits 371 375 +4
Misses 22 22
|
|
Umm, somehow MTK tests aren't running on Julia 1.6. I guess it's still OK to merge since |
I added two tests that fail on Unityper master, and should exemplify the sort of problem that caused the original typeassert commit to be reverted.