Skip to content

Relax type constraints #806

Description

@adigitoleo

A few times now I have run into MethodErrors from this package due to its strict type constraints. I think some of the type declarations could be relaxed, either by changing to a more abstract type or by removing them if they aren't needed.

See also https://www.oxinabox.net/2020/04/19/Julia-Antipatterns.html#over-constraining-argument-types and JuliaLang/julia#43811

Some ideas:

  • Rework parametric type declarations and constructors
  • ::Array -> ::AbstractArray
  • ::Vector -> ::AbstractVector
  • ::Matrix->::AbstractMatrix`
  • ::String -> ::AbstractString (or removed)
  • remove type constraints for solo methods (unless kept for readability)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions