Skip to content

All default value factories should be generic #1971

Closed

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Parser and Binderbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions