dotnet / dotnet/command-line-api

SetHandler error cannot convert from 'method group' to 'Action<FooStruct?>'

Open
#2,086 4 comments 0 reactions 1 assignee Claimed by @adamsitnik View on GitHub
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Seems like SetHandler cannot bind Option? with Handler(A a) when A is struct.

Please find the [minimal sample over here](https://github.com/codingdave/SystemCommandLineStructIssue), which has the exact code for a class and a struct where it is working for the class and failing for the struct with

error CS1503: Argument 2: cannot convert from 'method group' to 'Action'

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.