Skip to content
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

TupleCommaSpacing false positive #567

Open
Leaxe opened this issue Sep 14, 2022 · 1 comment
Open

TupleCommaSpacing false positive #567

Leaxe opened this issue Sep 14, 2022 · 1 comment

Comments

@Leaxe
Copy link

Leaxe commented Sep 14, 2022

Description

TupleCommaSpacing rule triggers when the tuple comma spacing is correct in named optional parameter assignments.

Repro steps

type TestClass(arg1 : int, ?arg2 : int) =
    class end

let x = TestClass(1, ?arg2 = Some(2))

Expected behavior

No lint error.

Actual behavior

Comma in tuple instantiation should be followed by single space.
Error on line 45 starting at column 19
let x = TestClass(1, ?arg = Some(2))

Known workarounds

Removing the space in the tuple removes the error:

///...
let x = TestClass(1,?arg = Some(2))

Related information

  • Operating system - macOS
  • Branch - version 0.21.2
  • .NET Runtime, CoreCLR or Mono Version - .NET SDK 6.0.302
@Leaxe
Copy link
Author

Leaxe commented Sep 14, 2022

Additional false positive: TupleIndentation when using named optional parameter assignments:

type TestClass(arg1 : int, ?arg2 : int) =
    class end

let x = TestClass(
    1,
    ?arg2 = Some(2)
)

Results in:

Sub-expressions of tuple on different lines should have consistent indentation.
Error on line 72 starting at column 8
        1,
        ^ 

I'm not sure what the workaround is for this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant