Skip to content

#nullable enable #27

@robrich

Description

@robrich

If you put #nullable enable at the top of each file then you won't need to do this:

public Destination MapToDestination(this Source source)
{
  source == null ? throw new IHateYouException(nameof(source))
    : new Destination {
      // ...
    };
}

but instead can do this:

public Destination MapToDestination(this Source source)
{
  new Destination {
    // ...
  };
}

public Destination? MapToDestinationNullable(this Source? source)
{
  source == null
    ? null
    : new Destination {
      // ...
    };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions