Skip to content

Commit

Permalink
Fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma committed Aug 9, 2023
1 parent e037a52 commit 8c38657
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/NumField/NfRel/absolute_field.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,13 @@ end

function absolute_simple_field(K::NfAbsNS; cached::Bool = true, simplify::Bool = false)
abs = get_attribute(K, :abs_simple_field)
MT = morphism_type(AnticNumberField, NfAbsNS)
if abs !== nothing
if haskey(abs, simplify)
return abs[simplify][1]::AnticNumberField, abs[simplify][2]
if haskey(abs::Dict{Bool, Tuple{AnticNumberField, MT}}, simplify)
return abs[simplify]::Tuple{AnticNumberField, MT}

Check warning on line 108 in src/NumField/NfRel/absolute_field.jl

View check run for this annotation

Codecov / codecov/patch

src/NumField/NfRel/absolute_field.jl#L107-L108

Added lines #L107 - L108 were not covered by tests
end
else
abs = Dict{Bool, Tuple{AnticNumberField, Map}}()
abs = Dict{Bool, Tuple{AnticNumberField, MT}}()
set_attribute!(K, :abs_simple_field => abs)
end
L, mL = simple_extension(K, cached = cached, simplified = simplify)
Expand All @@ -117,14 +118,15 @@ end

function absolute_simple_field(K::NumField; cached::Bool = false, simplify::Bool = false)
local Kabs::AnticNumberField
MT = morphism_type(AnticNumberField, typeof(K))

abs = get_attribute(K, :abs_simple_field)
if abs !== nothing
if haskey(abs, simplify)
return abs[simplify][1]::AnticNumberField, abs[simplify][2]
return abs[simplify]::Tuple{AnticNumberField, MT}
end
else
abs = Dict{Bool, Tuple{AnticNumberField, Map}}()
abs = Dict{Bool, Tuple{AnticNumberField, MT}}()
set_attribute!(K, :abs_simple_field => abs)
end

Expand All @@ -145,14 +147,15 @@ end
#Special function for NfRel{nf_elem}. In this case, we can easily construct the
#inverse of the isomorphism, so we do it separately
function absolute_simple_field(K::NfRel{nf_elem}; cached::Bool = false, simplify::Bool = false)
MT = morphism_type(AnticNumberField, typeof(K))

abs = get_attribute(K, :abs_simple_field)
if abs !== nothing
if haskey(abs, simplify)
return abs[simplify][1]::AnticNumberField, abs[simplify][2]
return abs[simplify]::Tuple{AnticNumberField, MT}
end
else
abs = Dict{Bool, Tuple{AnticNumberField, Map}}()
abs = Dict{Bool, Tuple{AnticNumberField, MT}}()
set_attribute!(K, :abs_simple_field => abs)
end

Expand Down

0 comments on commit 8c38657

Please sign in to comment.