Skip to content

Document type-stable constructors #96

Closed as not planned
Closed as not planned
@gdalle

Description

@gdalle

Right now, only the constructors with keyword arguments are part of the public API for ADTypes.
This is problematic because e.g. AutoForwardDiff(; chunksize, tag) is type-unstable while AutoForwardDiff{chunksize,typeof(tag)}(tag) is not.
As a result, DI (and probably other packages too) are forced to use undocumented internal API that may break without notice whenever they want to construct backends efficiently. I suggest we document type-stable variants of every constructor when possible, even if it means adding fallbacks when the number of type parameters increases. For instance, if someday there is an AutoForwardDiff{chunksize,T,whatever}, then AutoForwardDiff{chunksize,T}(tag) should still work.

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions