Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

type stability: `(::Polynomial)(::ImmutablePolynomial)` composition yields `ImmutablePolynomial`

Open
#520 2 comments 0 reactions 0 assignees View on GitHub

@jverzani is already working on this.

Since Aug 17, 2023.

  • #524 by @jverzani — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
backend

Research direction

Start by reproducing the Julia REPL example with Polynomial and ImmutablePolynomial, then trace the callable composition behavior involved in q(p). The issue names no source file or test; done means the composition has a concrete, type-stable return type without incorrectly returning an ImmutableDensePolynomial.

Written by the indexing model from the issue text.

Description

With v4.0.0:

julia> using Test, Polynomials

julia> p = ImmutablePolynomial((1,))
ImmutablePolynomial(1)

julia> q = Polynomial([10, 20])
Polynomial(10 + 20*x)

julia> @inferred q(p)
ERROR: return type Polynomials.ImmutableDensePolynomial{Polynomials.StandardBasis, Int64, :x, 1} does not match inferred return type Any

It doesn't make sense for this composition to return an ImmutableDensePolynomial, because that makes type stability impossible, because the degree of q is not available in the type domain.

Dominant language
Julia
Stars
321
Forks
81
Avg merge
10h 1m
Merged PRs (30d)
5

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaMath/Polynomials.jl

All issues in JuliaMath/Polynomials.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.