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

fix: check argument for map of polynomial rings #4398

Merged
merged 1 commit into from
Dec 12, 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
1 change: 1 addition & 0 deletions src/Rings/MPolyMap/MPolyQuo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ end
# The two main evaluation methods
function (F::MPolyAnyMap{<: MPolyQuoRing})(g)
if g isa elem_type(domain(F))
@req parent(g) === domain(F) "Element not in domain"
if coefficient_map(F) === nothing
return _evaluate_plain(F, g)
else
Expand Down
10 changes: 10 additions & 0 deletions test/Rings/MPolyAnyMap/MPolyQuo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,14 @@ end
# The test is whether the following two lines work at all
AtoR = @inferred hom(A, R, QtoR, [ x^2, y^2, x*y ])
@test isone(AtoR(A(1)))

let
Qt, (t,) = polynomial_ring(QQ, [:t])
QT, (T,) = polynomial_ring(QQ, [:T])
Q1, = quo(Qt, ideal(Qt, [t]))
Q2, = quo(QT, ideal(QT, [T^2]))
h = hom(Q2, Q1, [Qt(t)])
@test_throws ArgumentError h(t)
end

end
Loading