dotnet / dotnet/fsharp

Impossible to specify DefaultParameterValue for a generic type

Open
#8,551 1 comment 2 reactions 0 assignees View on GitHub
Area-Compiler-Checking Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

Impossible to specify DefaultParameterValue for a generic type.
That would look like this in C#
```cs
public void M(T x = default) { }
```

IL definitely looks a bit funky `.param [1] = nullref`
https://sharplab.io/#v2:C4LglgNgPgAgTARgLACgYGYAE9MGFMDeqmJ2WMALJgLIA8AKgHwAU9mAHpgLyYAmApgDMAhgFcIwAJSFipAL6o5QA===

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.