Skip to content

dotnet: support optional arguments in methods and constructors #210

Closed

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.

Activity

  1. added
    language/dotnet
    on Oct 25, 2018
  2. changed the title [-]`jsii-dotnet-generator` should supply default values for arguments with optional types[/-] [+]dotnet: support optional arguments in methods and constructors[/+] on Nov 15, 2018
  3. added
    effort/small
    on Apr 22, 2019
  4. added this to the milestone on Jul 30, 2019
  5. added a commit that references this issue on Aug 9, 2019
    e8b5a35
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

    effort/smalllanguage/dotnetp0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions