Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some type assertions #831

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ideal/IdealTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mutable struct IdealSet{T <: AbstractAlgebra.NCRingElem} <: Set
function IdealSet{T}(R::PolyRing) where T
return get!(IdealSetID, R) do
new(R)
end
end::IdealSet{T}
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/matrix/MatrixTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutable struct matrix_space{T <: Nemo.RingElem} <: Set
function matrix_space{T}(R::PolyRing, r::Int, c::Int) where T
return get!(MatrixSpaceID, (R, r, c)) do
new{T}(R, r, c)
end
end::matrix_space{T}
end
end

Expand Down
4 changes: 2 additions & 2 deletions src/module/ModuleTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mutable struct FreeMod{T <: Nemo.RingElem} <: Module{T}
function FreeMod{T}(R::PolyRing, r::Int) where T
return get!(FreeModID, (R, r)) do
new(R, r)
end
end::FreeMod{T}
end
end

Expand Down Expand Up @@ -63,7 +63,7 @@ mutable struct ModuleClass{T <: Nemo.RingElem} <: Set
function ModuleClass{T}(R::PolyRing) where T
return get!(ModuleClassID, R) do
new(R)
end
end::ModuleClass{T}
end
end

Expand Down
6 changes: 2 additions & 4 deletions src/number/NumberTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ mutable struct Integers <: Ring
return get!(IntegersID, :ZZ) do
ptr = libSingular.nInitChar(libSingular.n_Z, Ptr{Nothing}(0))
d = new(ptr, 0)
IntegersID[:ZZ] = d
finalizer(_Ring_finalizer, d)
return d
end
end::Integers
end
end

Expand Down Expand Up @@ -78,10 +77,9 @@ mutable struct Rationals <: Field
return get!(RationalsID, :QQ) do
ptr = libSingular.nInitChar(libSingular.n_Q, Ptr{Nothing}(0))
d = new(ptr, 0)
RationalsID[:QQ] = d
finalizer(_Ring_finalizer, d)
return d
end
end::Rationals
end
end

Expand Down
Loading