JuliaIO / IniFile.jl

Reading and writing Windows-style INI files (writing not yet implemented).
Other
14 stars 19 forks source link

Ambiguity in get function #16

Open tknopp opened 8 years ago

tknopp commented 8 years ago

The following definitions are ambiguous

 get(inifile::IniFile.Inifile, section::AbstractString, key::AbstractString) 
 get(inifile::IniFile.Inifile, key::AbstractString, notfound)

if the default value notfound is of type AbstractString

hustf commented 8 years ago

But is it ever? Does it produce ambiguity warnings?

tknopp commented 8 years ago

No, of course not always. Actually this produced a very subtle bug when changing get(inifile, key, 1.0) to get(inifile, key, "1.0") API-wise its not clear to me why get(inifile::IniFile.Inifile, key::AbstractString, notfound) should be accessible for any type but a String.

So this bug was meant to report this API issue.