Skip to content

Missing argument compiles without error and throws CLR error during runtime #15955

Closed
@kdurkin77

Description

@kdurkin77

If we leave out an argument by mistake the compiler doesn't error and we can even run the code, but on runtime it crashes

This code compiles successfully when it shouldn't:
let x = doesnt.exist(, nor.this.either, also.nope)
image

This code does not compile successfully as it shouldn't:
let x = doesnt.exist(nope, nor.this.either, also.nope)
image

Repro steps

  1. Open fs file in Visual Studio Code
    MissingArgumentShouldNotCompile.zip
  2. See no errors
  3. Try to run and see a CLR error and crash

Expected behavior
The code should not compile

Actual behavior
The code compiles

Known workarounds
None

Related information
Seen in both Visual Studio Code 1.82.0 and Visual Studio 2022 17.7.3 (both up to date)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-Syntaxlexfilter, indentation and parsingBugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.Regression

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions