Skip to content

Commit

Permalink
!fixup Add more typeasserts
Browse files Browse the repository at this point in the history
  • Loading branch information
staticfloat committed Oct 15, 2020
1 parent ec8e99f commit 05f7682
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1538,12 +1538,12 @@ end
function get_uuid_name(project::Dict, uuid::UUID)
if haskey(project, "uuid") && haskey(project, "name") &&
UUID(project["uuid"]) == uuid
return project["name"]
return project["name"]::String
elseif haskey(project, "deps")
struuid = string(uuid)
for (k, v) in project["deps"]
if v == struuid
return k
if v::String == struuid
return k::String
end
end
end
Expand All @@ -1558,13 +1558,13 @@ end

function collect_preferences!(project_toml::String, uuid::UUID)
# We'll return a list of dicts to be merged
dicts = Dict[]
dicts = Dict{String, Any}[]

# Get the name of this UUID to this project; if it can't find it, skip out.
project = parsed_toml(project_toml)
pkg_name = get_uuid_name(project, uuid)
if pkg_name === nothing
return Dict[]
return dicts
end

# Look first inside of `Project.toml` to see we have preferences embedded within there
Expand All @@ -1578,7 +1578,7 @@ function collect_preferences!(project_toml::String, uuid::UUID)
toml_path = joinpath(project_dir, name)
if isfile(toml_path)
prefs = parsed_toml(toml_path)
push!(dicts, get(prefs, pkg_name, Dict()))
push!(dicts, get(prefs, pkg_name, Dict{String,Any}())::Dict{String,Any})

# If we find `JuliaLocalPreferences.toml`, don't look for `LocalPreferences.toml`
break
Expand Down

0 comments on commit 05f7682

Please sign in to comment.