Skip to content

Commit

Permalink
Add explicit Any for all @attr functionexpr cases (#4070)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Sep 5, 2024
1 parent a854435 commit a23499c
Show file tree
Hide file tree
Showing 27 changed files with 89 additions and 89 deletions.
4 changes: 2 additions & 2 deletions experimental/GModule/src/GModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ end

gmodule(k::fpField, C::GModule{<:Any, <:AbstractAlgebra.FPModule{fpFieldElem}}) = C

@attr function _character(C::GModule{<:Any, <:AbstractAlgebra.FPModule{<:AbstractAlgebra.FieldElem}})
@attr Any function _character(C::GModule{<:Any, <:AbstractAlgebra.FPModule{<:AbstractAlgebra.FieldElem}})
G = group(C)
phi = epimorphism_from_free_group(G)
ac = Oscar.GrpCoh.action(C)
Expand Down Expand Up @@ -841,7 +841,7 @@ end

Oscar.character_field(C::GModule{<:Any, <:AbstractAlgebra.FPModule{QQFieldElem}}) = QQ

@attr function _character_field(C::GModule{<:Any, <:AbstractAlgebra.FPModule{AbsSimpleNumFieldElem}})
@attr Any function _character_field(C::GModule{<:Any, <:AbstractAlgebra.FPModule{AbsSimpleNumFieldElem}})
val = _character(C)
k, mkK = Hecke.subfield(base_ring(C), [x[2] for x = val])
return k, mkK
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/src/AlgebraicCycles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ function Base.show(io::IO, D::AlgebraicCycle)
end


@attr function dim(D::AlgebraicCycle)
@attr Any function dim(D::AlgebraicCycle)
result = -1
for I in components(D)
d = dim(I)
Expand Down
6 changes: 3 additions & 3 deletions experimental/Schemes/src/CoherentSheaves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ end
For a `SheafOfModules` ``ℳ`` on an `AbsCoveredScheme` ``X``, return
the ``𝒪_X``-dual ``ℋ om_{𝒪_X}(ℳ , 𝒪_X)`` of ``ℳ``.
"""
@attr function dual(M::SheafOfModules)
@attr Any function dual(M::SheafOfModules)
OOX = sheaf_of_rings(M)
F = free_module(OOX, ["1"])
return HomSheaf(M, F)
Expand Down Expand Up @@ -1431,7 +1431,7 @@ end
end

#@attr Covering function trivializing_covering(M::AbsCoherentSheaf)
@attr function trivializing_covering(M::AbsCoherentSheaf)
@attr Any function trivializing_covering(M::AbsCoherentSheaf)
X = scheme(M)
OOX = OO(X)
patch_list = Vector{AbsAffineScheme}()
Expand Down Expand Up @@ -1466,7 +1466,7 @@ function inherit_decomposition_info!(C::Covering, X::AbsCoveredScheme)
return C
end

@attr function trivializing_covering(M::HomSheaf)
@attr Any function trivializing_covering(M::HomSheaf)
X = scheme(M)
OOX = OO(X)
# The problem is that every module of a HomSheaf must know that it is
Expand Down
4 changes: 2 additions & 2 deletions experimental/Schemes/src/CoveredProjectiveSchemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ function _compute_gluing(gd::ProjectiveGluingData)
return pr
end

@attr function covered_scheme(P::CoveredProjectiveScheme)
@attr Any function covered_scheme(P::CoveredProjectiveScheme)
X = base_scheme(P)
C = base_covering(P)
new_patches = Vector{AbsAffineScheme}()
Expand Down Expand Up @@ -989,7 +989,7 @@ end
return result
end

@attr function covered_projection_to_base(P::CoveredProjectiveScheme)
@attr Any function covered_projection_to_base(P::CoveredProjectiveScheme)
if !has_attribute(P, :covering_projection_to_base)
covered_scheme(P)
end
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/src/CoveredScheme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ end
end

# coefficient ring an MPolyAnyRing
@attr function standard_covering(X::AbsProjectiveScheme{CRT, <:Union{<:MPolyDecRing, <:MPolyQuoRing}}) where {CRT<:Union{<:MPolyQuoLocRing, <:MPolyLocRing, <:MPolyRing, <:MPolyQuoRing}}
@attr Any function standard_covering(X::AbsProjectiveScheme{CRT, <:Union{<:MPolyDecRing, <:MPolyQuoRing}}) where {CRT<:Union{<:MPolyQuoLocRing, <:MPolyLocRing, <:MPolyRing, <:MPolyQuoRing}}
Y = base_scheme(X)
R = ambient_coordinate_ring(Y)
kk = coefficient_ring(R)
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/src/IdealSheaves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ Return whether ``I`` is prime.
We say that a sheaf of ideals is prime if its support is irreducible and
``I`` is locally prime. (Note that the empty set is not irreducible.)
"""
@attr function is_prime(I::AbsIdealSheaf)
@attr Any function is_prime(I::AbsIdealSheaf)
is_locally_prime(I) || return false
# TODO: this can be made more efficient
PD = maximal_associated_points(I)
Expand Down
4 changes: 2 additions & 2 deletions experimental/Schemes/src/MorphismFromRationalFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,11 @@ end
# But they can be set by the user so that certain checks of other methods
# are satisfied; i.e. the user has to take responsibility and confirm that
# they know what they're doing through these channels.
@attr function is_proper(phi::AbsCoveredSchemeMorphism)
@attr Any function is_proper(phi::AbsCoveredSchemeMorphism)
error("no method implemented to check properness")
end

@attr function is_isomorphism(phi::AbsCoveredSchemeMorphism)
@attr Any function is_isomorphism(phi::AbsCoveredSchemeMorphism)
error("no method implemented to check for being an isomorphism")
end

Expand Down
8 changes: 4 additions & 4 deletions experimental/Schemes/src/WeilDivisor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ end
### forwarding of all essential functionality
underlying_cycle(D::WeilDivisor) = D.C

@attr function dim(I::AbsIdealSheaf)
@attr Any function dim(I::AbsIdealSheaf)
dims = [dim(I(U)) for U in affine_charts(scheme(I))]
return maximum(dims)
end
Expand Down Expand Up @@ -401,12 +401,12 @@ function intersect(D::AbsWeilDivisor, E::AbsWeilDivisor;
return result
end

@attr function has_dimension_leq_zero(I::Ideal)
@attr Any function has_dimension_leq_zero(I::Ideal)
is_one(I) && return true
return dim(I) <= 0
end

@attr function has_dimension_leq_zero(I::MPolyLocalizedIdeal)
@attr Any function has_dimension_leq_zero(I::MPolyLocalizedIdeal)
R = base_ring(I)
P = base_ring(R)::MPolyRing
J = ideal(P, numerator.(gens(I)))
Expand All @@ -415,7 +415,7 @@ end
return dim(I) <= 0
end

@attr function has_dimension_leq_zero(I::MPolyQuoLocalizedIdeal)
@attr Any function has_dimension_leq_zero(I::MPolyQuoLocalizedIdeal)
R = base_ring(I)
P = base_ring(R)::MPolyRing
J = ideal(P, lifted_numerator.(gens(I)))
Expand Down
10 changes: 5 additions & 5 deletions experimental/Schemes/src/elliptic_surface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ The first return value is the basis of the ambient space of `L`.
The second consists of additional generators for `L` coming from torsion sections.
The third is ``L``.
"""
@attr function algebraic_lattice(X::EllipticSurface)
@attr Any function algebraic_lattice(X::EllipticSurface)
return _algebraic_lattice(X,X.MWL)
end

Expand Down Expand Up @@ -335,7 +335,7 @@ end
Return the torsion part of the Mordell-Weil group of the generic fiber of ``S``.
"""
@attr function mordell_weil_torsion(S::EllipticSurface)
@attr Any function mordell_weil_torsion(S::EllipticSurface)
E = generic_fiber(S)
O = E([0,1,0])
N = trivial_lattice(S)[2]
Expand Down Expand Up @@ -729,7 +729,7 @@ Internal function. Returns a list consisting of:
- gram matrix
- fiber_components without multiplicities
"""
@attr function _trivial_lattice(S::EllipticSurface)
@attr Any function _trivial_lattice(S::EllipticSurface)
#=
inc_Y = S.inc_Y
X = codomain(inc_Y)
Expand Down Expand Up @@ -977,7 +977,7 @@ function fiber_components(S::EllipticSurface, P; algorithm=:exceptional_divisors
return fiber_components
end

@attr function exceptional_divisors(S::EllipticSurface)
@attr Any function exceptional_divisors(S::EllipticSurface)
PP = AbsIdealSheaf[]
@vprintln :EllipticSurface 2 "computing exceptional divisors"
for E in S.ambient_exceptionals
Expand Down Expand Up @@ -1107,7 +1107,7 @@ end
Return the zero section of the relatively minimal elliptic
fibration \pi\colon X \to C$.
"""
@attr zero_section(S::EllipticSurface) = _section(S, generic_fiber(S)([0,1,0]))
@attr Any zero_section(S::EllipticSurface) = _section(S, generic_fiber(S)([0,1,0]))

################################################################################
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Avoid computing the reduced structure by using fat_scheme
################################################################################

@attr dim(X::AbsAffineAlgebraicSet) = dim(fat_scheme(X))
@attr Any dim(X::AbsAffineAlgebraicSet) = dim(fat_scheme(X))
34 changes: 17 additions & 17 deletions src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ end
Return the total ring of fractions of the coordinate ring of `X`.
"""
@attr function total_ring_of_fractions(X::AbsAffineScheme)
@attr Any function total_ring_of_fractions(X::AbsAffineScheme)
return total_ring_of_fractions(OO(X))
end

Expand Down Expand Up @@ -196,15 +196,15 @@ function ambient_space(X::AbsAffineScheme{BRT, RT}) where {BRT, RT<:MPolyRing}
return X
end

@attr function ambient_space(X::AffineScheme{BRT,RT}) where {BRT<:Field, RT <: Union{MPolyQuoRing,MPolyLocRing,MPolyQuoLocRing}}
@attr Any function ambient_space(X::AffineScheme{BRT,RT}) where {BRT<:Field, RT <: Union{MPolyQuoRing,MPolyLocRing,MPolyQuoLocRing}}
return variety(spec(ambient_coordinate_ring(X)), check=false)
end

@attr function ambient_space(X::AffineScheme{BRT,RT}) where {BRT, RT <: Union{MPolyQuoRing,MPolyLocRing,MPolyQuoLocRing}}
@attr Any function ambient_space(X::AffineScheme{BRT,RT}) where {BRT, RT <: Union{MPolyQuoRing,MPolyLocRing,MPolyQuoLocRing}}
return spec(ambient_coordinate_ring(X))
end

@attr function ambient_space(X::AbsAffineScheme{BRT,RT}) where {BRT, RT <: Union{MPolyQuoRing,MPolyLocRing,MPolyQuoLocRing}}
@attr Any function ambient_space(X::AbsAffineScheme{BRT,RT}) where {BRT, RT <: Union{MPolyQuoRing,MPolyLocRing,MPolyQuoLocRing}}
return ambient_space(underlying_scheme(X))
end

Expand Down Expand Up @@ -401,41 +401,41 @@ julia> dim(Y) # one dimension comes from ZZ and two from x1 and x2
"""
dim(X::AbsAffineScheme)

@attr function dim(X::AbsAffineScheme{<:Ring, <:MPolyQuoLocRing})
@attr Any function dim(X::AbsAffineScheme{<:Ring, <:MPolyQuoLocRing})
error("Not implemented")
end

@attr function dim(X::AbsAffineScheme{<:Ring, <:MPolyQuoLocRing{<:Any,<:Any,<:MPolyRing,<:MPolyRingElem, <:MPolyPowersOfElement}})
@attr Any function dim(X::AbsAffineScheme{<:Ring, <:MPolyQuoLocRing{<:Any,<:Any,<:MPolyRing,<:MPolyRingElem, <:MPolyPowersOfElement}})
return dim(closure(X))
end

@attr function dim(X::AbsAffineScheme{<:Ring, <:MPolyQuoLocRing{<:Any,<:Any,<:MPolyRing,<:MPolyRingElem, <:Union{MPolyComplementOfPrimeIdeal, MPolyComplementOfKPointIdeal}}})
@attr Any function dim(X::AbsAffineScheme{<:Ring, <:MPolyQuoLocRing{<:Any,<:Any,<:MPolyRing,<:MPolyRingElem, <:Union{MPolyComplementOfPrimeIdeal, MPolyComplementOfKPointIdeal}}})
# Spec (R / I)_P
R = OO(X)
P = prime_ideal(inverted_set(R))
I = saturated_ideal(modulus(R))
return dim(I) - dim(P)
end

@attr function dim(X::AbsAffineScheme{<:Ring, <:MPolyLocRing})
@attr Any function dim(X::AbsAffineScheme{<:Ring, <:MPolyLocRing})
error("Not implemented")
end

@attr function dim(X::AbsAffineScheme{<:Ring, <:MPolyLocRing{<:Any,<:Any,<:MPolyRing,<:MPolyRingElem, <:MPolyPowersOfElement}})
@attr Any function dim(X::AbsAffineScheme{<:Ring, <:MPolyLocRing{<:Any,<:Any,<:MPolyRing,<:MPolyRingElem, <:MPolyPowersOfElement}})
# zariski open subset of A^n
return dim(closure(X))
end

@attr function dim(X::AbsAffineScheme{<:Ring, <:MPolyLocRing{<:Any,<:Any,<:MPolyRing,<:MPolyRingElem, <:Union{MPolyComplementOfPrimeIdeal, MPolyComplementOfKPointIdeal}}})
@attr Any function dim(X::AbsAffineScheme{<:Ring, <:MPolyLocRing{<:Any,<:Any,<:MPolyRing,<:MPolyRingElem, <:Union{MPolyComplementOfPrimeIdeal, MPolyComplementOfKPointIdeal}}})
P = prime_ideal(inverted_set(OO(X)))
return codim(P)
end

@attr function dim(X::AbsAffineScheme{<:Ring, <:MPolyRing})
@attr Any function dim(X::AbsAffineScheme{<:Ring, <:MPolyRing})
return dim(ideal(ambient_coordinate_ring(X), [zero(ambient_coordinate_ring(X))]))
end

@attr function dim(X::AbsAffineScheme{<:Ring, <:MPolyQuoRing})
@attr Any function dim(X::AbsAffineScheme{<:Ring, <:MPolyQuoRing})
return dim(modulus(OO(X)))
end

Expand Down Expand Up @@ -477,7 +477,7 @@ julia> codim(Y)
1
```
"""
@attr function codim(X::AbsAffineScheme)
@attr Any function codim(X::AbsAffineScheme)
return dim(ideal(ambient_coordinate_ring(X), [zero(ambient_coordinate_ring(X))])) - dim(X)
end

Expand Down Expand Up @@ -573,7 +573,7 @@ julia> reduced_scheme(Y)
```
"""
@attr function reduced_scheme(X::AbsAffineScheme{<:Field, <:MPolyQuoLocRing})
@attr Any function reduced_scheme(X::AbsAffineScheme{<:Field, <:MPolyQuoLocRing})
if has_attribute(X, :is_reduced) && is_reduced(X)
return X, identity_map(X)
end
Expand All @@ -585,7 +585,7 @@ julia> reduced_scheme(Y)
return Xred, inc
end

@attr function reduced_scheme(X::AbsAffineScheme{<:Field, <:MPolyQuoRing})
@attr Any function reduced_scheme(X::AbsAffineScheme{<:Field, <:MPolyQuoRing})
if has_attribute(X, :is_reduced) && is_reduced(X)
return X, identity_map(X)
end
Expand All @@ -597,7 +597,7 @@ end
end

## to make reduced_scheme agnostic for quotient ring
@attr function reduced_scheme(X::AbsAffineScheme{<:Field, <:MPAnyNonQuoRing})
@attr Any function reduced_scheme(X::AbsAffineScheme{<:Field, <:MPAnyNonQuoRing})
return X, ClosedEmbedding(X, ideal(OO(X), one(OO(X))), check=false)
end

Expand Down Expand Up @@ -873,7 +873,7 @@ true
```
"""
defining_ideal(X::AbsAffineScheme) = error("method not implemented for input of type $(typeof(X))")
@attr defining_ideal(X::AbsAffineScheme{<:Any, <:MPolyRing}) = ideal(OO(X), [zero(OO(X))])
@attr Any defining_ideal(X::AbsAffineScheme{<:Any, <:MPolyRing}) = ideal(OO(X), [zero(OO(X))])
defining_ideal(X::AbsAffineScheme{<:Any, <:MPolyQuoRing}) = modulus(OO(X))
defining_ideal(X::AbsAffineScheme{<:Any, <:MPolyLocRing}) = modulus(OO(X))
defining_ideal(X::AbsAffineScheme{<:Any, <:MPolyQuoLocRing}) = modulus(OO(X))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function dim(X::AbsCoveredScheme)
return get_attribute(X, :dim)::Int
end

@attr function singular_locus_reduced(X::AbsCoveredScheme)
@attr Any function singular_locus_reduced(X::AbsCoveredScheme)
D = IdDict{AbsAffineScheme, Ideal}()
for U in affine_charts(X)
_, inc_sing = singular_locus_reduced(U)
Expand Down Expand Up @@ -257,7 +257,7 @@ given by the pullback function
(y//z) -> 0
```
"""
@attr function singular_locus(
@attr Any function singular_locus(
X::AbsCoveredScheme;
)
D = IdDict{AbsAffineScheme, Ideal}()
Expand Down
4 changes: 2 additions & 2 deletions src/AlgebraicGeometry/Schemes/Gluing/Attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end
Return the gluing `H` with `patches`, `gluing_domains`,
and `gluing_morphisms` in opposite order compared to `G`.
"""
@attr function inverse(G::AbsGluing)
@attr Any function inverse(G::AbsGluing)
Ginv = inverse(underlying_gluing(G))
set_attribute!(Ginv, :inverse, G)
set_attribute!(G, :inverse, Ginv)
Expand All @@ -57,7 +57,7 @@ end
patches(G::Gluing) = G.X, G.Y
gluing_morphisms(G::Gluing) = G.f, G.g
gluing_domains(G::Gluing) = domain(G.f), domain(G.g)
@attr function inverse(G::Gluing)
@attr Any function inverse(G::Gluing)
Ginv = Gluing(G.Y, G.X, G.g, G.f, check=false)
set_attribute!(Ginv, :inverse, G)
return Ginv
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
########################################################################
# Properties of PrincipalOpenSubsets #
########################################################################
@attr function is_dense(U::PrincipalOpenSubset)
@attr Any function is_dense(U::PrincipalOpenSubset)
return !is_zero_divisor(complement_equation(U))
end

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function ==(f::AbsProjectiveSchemeMorphism{<:AbsProjectiveScheme{<:Union{<:MPoly
return map_on_affine_cones(f) == map_on_affine_cones(g)
end

@attr function covered_scheme_morphism(
@attr Any function covered_scheme_morphism(
f::AbsProjectiveSchemeMorphism{<:Any, <:Any, <:Any, Nothing} # No map on base rings
)
PX = domain(f)
Expand Down Expand Up @@ -114,7 +114,7 @@ with default covering
3: [(x//z), (y//z)]
```
"""
@attr function covered_scheme_morphism(
@attr Any function covered_scheme_morphism(
f::AbsProjectiveSchemeMorphism
) # with map on the base rings
PX = domain(f)
Expand Down
Loading

0 comments on commit a23499c

Please sign in to comment.