Skip to content

dotnet: support optional arguments in methods and constructors #210

@mpiroc

Description

@mpiroc

jsii methods/constructors can have optional arguments. The .NET generator should respect those and pass null in calls that don't supply them.

-- from @mpiroc:

jsii-dotnet-generator should supply default values for arguments with optional types

jsii-dotnet-generator ensures that null is a valid value for types marked optional in JSII. For value types, this means making them nullable, i.e. int?. For reference types, null is already a valid value.

When a type like this is used in a parameter list, jsii-dotnet-generator should create a default value of null for the parameter. Currently, the user has to explicitly pass null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/smallSmall work item – less than a day of effortlanguage/dotnetRelated to .NET bindings (C#, F#, ...)p0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions