-
Notifications
You must be signed in to change notification settings - Fork 854
Open
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.good first issue
Milestone
Description
Please provide a succinct description of the issue.
Repro steps
open System.Runtime.InteropServices
type C() =
member _.M ([<Optional; DefaultParameterValue([||]:byte[])>]keyBytes:byte[]) =
keyBytes
Expected behavior
The code either passes empty array as default argument or doesn't compile
Actual behavior
The code compiles, but parameter is not optional anymore, I can't call M() without parameters sharplab
Known workarounds
Use null instead of empty array. Fsharp-style optional argument won't work, since the method is exposed from library
Related information
.NET Core SDK (reflecting any global.json):
Version: 3.1.101
Commit: b377529961
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.good first issue
Type
Projects
Status
New