-
Notifications
You must be signed in to change notification settings - Fork 831
Closed
Labels
Milestone
Description
Consider the following code example:

let a =
System.Text.RegularExpressions.Regex.IsMatch(
"myInput",
"""^[a-zA-Z][a-zA-Z0-9']+$"""
)
if System.Text.RegularExpressions.Regex.IsMatch(
"myInput",
"""^[a-zA-Z][a-zA-Z0-9']+$"""
) then
()I get an indentation warning when the function call is inside the if condition.
But not when it is used in a let binding body.
Expected behavior
I would expect both cases not to show any warnings.
Actual behavior
Warning for the expression inside the if/then/else
Known workarounds
Wrap the if condition inside parenthesises.
if (System.Text.RegularExpressions.Regex.IsMatch(
"myInput",
"""^[a-zA-Z][a-zA-Z0-9']+$"""
)) then
()Related information
Provide any related information (optional):
- Operating system: Win 10
- .NET Runtime kind (.NET Core, .NET Framework, Mono): .NET 5
- Editing Tools (e.g. Visual Studio Version, Visual Studio): FCS 38.0.0
Related Fantomas bug: fsprojects/fantomas#1349