-
Notifications
You must be signed in to change notification settings - Fork 7
CompatHelper: bump compat for Bijections to 0.2, (keep existing compat) #96
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
CompatHelper: bump compat for Bijections to 0.2, (keep existing compat) #96
Conversation
84fd707 to
009ccc6
Compare
|
In JuliaCollections/Bijections.jl#15 (comment), @mofeing wrote:
It seems like I don't even have to do that! pkg> add Bijections
Resolving package versions...
Updating `/private/var/folders/mm/rr6dgkzj0l5_j_ntxcg_hlth0000gn/T/jl_ijf7Kj/Project.toml`
[e2ed5e7c] + Bijections v0.2.1
julia> using Bijections
julia> struct MyStruct
d::Bijections.Bijection{String,String}
end
julia> MyStruct(Bijection{String,String}())
MyStruct(Bijection{String, String, Dict{String, String}, Dict{String, String}}())And, |
Be careful. The field is still non-concrete: julia> fieldtypes(MyStruct)
(Bijection{String, String},)
julia> fieldtypes(MyStruct) .|> isconcretetype
(false,)The reason why you see it as the full type is because calling Check out what happens when we analyze a function that accesses the julia> f(d) = d.d
f (generic function with 1 method)
julia> @code_typed f(x)
CodeInfo(
1 ─ %1 = Base.getfield(d, :d)::Bijection{String, String}
└── return %1
) => Bijection{String, String}The result is not concrete. but if we specify the full type in the struct... julia> struct MyStruct2
d::Bijections.Bijection{String,String,Dict{String,String},Dict{String,String}}
end
julia> y = MyStruct2(Bijection{String,String}())
MyStruct2(Bijection{String, String, Dict{String, String}, Dict{String, String}}())
julia> @code_typed f(y)
CodeInfo(
1 ─ %1 = Base.getfield(d, :d)::Bijection{String, String, Dict{String, String}, Dict{String, String}}
└── return %1
) => Bijection{String, String, Dict{String, String}, Dict{String, String}}Now it is. All behavior should be mostly the same, so it'll work for your case. But the type-inference will be affected. |
|
Right, yeah… I did figure I was moving from a concrete to non-concrete field, but I'm still surprised that the syntax works. I was actually ready to change that to just I'm fine with having a non-concrete field. There's already the The main concern is really with being compatible with as many releases of any dependency as possible. Documenter and plugins like DocumenterCitations are potentially dependencies for building the documentation of all Julia packages, so if I had to restrict to |
This pull request changes the compat entry for the
Bijectionspackage from0.1.4to0.1.4, 0.2.This keeps the compat entries for earlier versions.
Note: I have not tested your package with this new compat entry.
It is your responsibility to make sure that your package tests pass before you merge this pull request.