diff --git a/src/Hecke.jl b/src/Hecke.jl index 4e82997c2b..d5de31fd7e 100644 --- a/src/Hecke.jl +++ b/src/Hecke.jl @@ -556,6 +556,8 @@ order_type(T::DataType) = throw(MethodError(order_type, (T,))) embedding_type(x) = embedding_type(typeof(x)) embedding_type(T::DataType) = throw(MethodError(embedding_type, (T,))) +base_field_type(x) = base_field_type(typeof(x)) +base_field_type(T::DataType) = throw(MethodError(base_field_type, (T,))) ################################################################################ # diff --git a/src/LocalField/LocalField.jl b/src/LocalField/LocalField.jl index 20ccf69de5..335626b38a 100644 --- a/src/LocalField/LocalField.jl +++ b/src/LocalField/LocalField.jl @@ -37,14 +37,10 @@ prime(K::LocalField) = prime(base_field(K)) # ################################################################################ -base_field_type(K::LocalField{S, T}) where {S <: FieldElem, T <: LocalFieldParameter} = parent_type(S) base_field_type(::Type{LocalField{S, T}}) where {S <: FieldElem, T <: LocalFieldParameter} = parent_type(S) elem_type(::Type{LocalField{S, T}}) where {S <: FieldElem, T <: LocalFieldParameter} = LocalFieldElem{S, T} -dense_poly_type(K::LocalField{S, T}) where {S <: FieldElem, T <: LocalFieldParameter} = Generic.Poly{LocalFieldElem{S, T}} -dense_poly_type(::Type{LocalField{S, T}}) where {S <: FieldElem, T <: LocalFieldParameter} = Generic.Poly{LocalFieldElem{S, T}} - ################################################################################ # # Basic predicates diff --git a/src/Map/NumField.jl b/src/Map/NumField.jl index 24275814cb..64848a6a80 100644 --- a/src/Map/NumField.jl +++ b/src/Map/NumField.jl @@ -182,13 +182,9 @@ end # ################################################################################ -base_field_type(::AbsSimpleNumField) = QQField +base_field_type(::Type{AbsSimpleNumField}) = QQField -base_field_type(::AbsNonSimpleNumField) = QQField - -base_field_type(::RelSimpleNumField{T}) where {T} = parent_type(T) - -base_field_type(::RelNonSimpleNumField{T}) where {T} = parent_type(T) +base_field_type(::Type{AbsNonSimpleNumField}) = QQField base_field_type(::Type{RelNonSimpleNumField{T}}) where {T} = parent_type(T) diff --git a/src/Misc/RelFiniteField.jl b/src/Misc/RelFiniteField.jl index 2c030a6177..3d5eee6d01 100644 --- a/src/Misc/RelFiniteField.jl +++ b/src/Misc/RelFiniteField.jl @@ -56,6 +56,8 @@ function defining_polynomial(F::RelFinField{T}) where T return F.defining_polynomial::dense_poly_type(T) end +base_field_type(::Type{RelFinField{S}}) where S = parent_type(S) + base_field(F::RelFinField{S}) where S= base_ring(F.defining_polynomial)::parent_type(S) characteristic(F::RelFinField) = characteristic(base_field(F))