JuliaPackaging / Preferences.jl

Project Preferences Package
Other
130 stars 15 forks source link

Support key of type SubString{String} ? #35

Open sjdaines opened 2 years ago

sjdaines commented 2 years ago

ERROR: MethodError: no method matching load_preference(::Module, ::SubString{String}) Closest candidates are: load_preference(::Module, ::String) at C:\Users\Stuart.julia\packages\Preferences\TJoW1\src\Preferences.jl:35 load_preference(::Module, ::String, ::Any) at C:\Users\Stuart.julia\packages\Preferences\TJoW1\src\Preferences.jl:35

Perhaps just needs to use AbstractString instead of String ?

StefanKarpinski commented 2 years ago

Should just be a matter of widening ::String annotations on methods to ::AbstractString.

staticfloat commented 2 years ago

@sjdaines if you want to open a PR changing load_preference() to support AbstractString (and add a test for it) I'd be happy to review and merge!