FS0192 Internal Error with trivial code: DecisionTreeTest.Error should only be used during pattern match compilation #9296
Labels
Bug
Impact-Medium
(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Regression
Milestone
The following code creates the errors FS0192, FS0073 and again FS0192 in VS IDE Preview. I found this while creating a repro for the "40 min delay during between keystrokes"-bug (see #9201). This may be a regression, as earlier versions of VS 2019 do not exhibit this behavior.
When compiling, it shows:
The first error is expected, the warning is surprising, it normally doesn't show when the line has an error. The latter three errors are certainly unexpected ;).
FSC does not show this behavior, nor do earlier non-preview versions of the VS IDE.
Repro steps
*.fs
file.Expected behavior
Only two errors should be shown.
Actual behavior
Three internal errors are also shown. Internal errors are generally unexpected and, I believe, typically mean that something is wrong with the compiler. The internal errors are:
Known workarounds
If you fix the typo in your code, the internal error disappears. I noticed this behavior most prominently when doing solution-wide renames. Since the Rename Feature doesn't catch all cases, it can lead to this error. Above code is the smallest repro I could find.
Related information
static member foo
.EDIT: it seems remarkably similar to this line, but the text is slightly different:
fsharp/src/fsharp/TypedTreePickle.fs
Line 2406 in be621d8
The text was updated successfully, but these errors were encountered: