Skip to content

All default value factories should be generic #1971

Closed
@adamsitnik

Description

@adamsitnik

Currently, it's possible to cause type mismatch as Argument<T> and Option<T> expose a possibility to specify default value/factory as object. There is no guarantee that returned object is of type T.

Option<bool> runApiCompatOption = new("--run-api-compat", "....");
runApiCompatOption.SetDefaultValue(123); // providing int for a bool

follow up to #1891 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions