-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing argument compiles without error and throws CLR error during runtime #15955
Comments
Almost certainly a regression in recovery. No parsing error is raised despite the presence of |
Huh, @auduchinok, does this ring a bell? |
Also, this has happened in a full VS fsproj as well as the fsi like in the example |
Introduced in #15227 Bisect script used: dotnet build FSharp.Compiler.Service.sln -c Release
.\artifacts\bin\fsi\Release\net7.0\fsi.exe ..\reg15955.fsx
@echo off
if %ERRORLEVEL% EQU -1073741819 (
echo Failure Reason Given is %errorlevel%
exit /b 1
) else (
echo Success
exit /b 0
) reg15955.fsx: let x = doesnt.exist(, nor.this.either, also.nope)
|
@vzarytovskii @auduchinok, should there be a list of AST nodes that are known to not be allowed to "pass" to the code generation part? I see This contextual flag would then be used to prevent code generation. Would that be a good approach to prevent similar mishaps? Also, the infrastructure that runs those parser recovery tests could generate the IL baseline files, expecting them to be empty, and make the test to fail if not. |
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)
This code does not compile successfully as it shouldn't:
let x = doesnt.exist(nope, nor.this.either, also.nope)
Repro steps
MissingArgumentShouldNotCompile.zip
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)
The text was updated successfully, but these errors were encountered: