-
Notifications
You must be signed in to change notification settings - Fork 509
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
Experimental function-type-reference-spacing rule Unexpected whitespace for anonymous functions #1440
Milestone
Comments
paul-dingemans
added a commit
to paul-dingemans/ktlint
that referenced
this issue
Apr 2, 2022
…tion Rule should not depend on the existence of the function identifier as it is also possible to define anonymous functions. Checking of anonymous and named function should be identical. Closes pinterest#1440
Tnx for reporting. Your example is correct. I was not aware that anonymous functions could be declared this way. |
paul-dingemans
added a commit
to paul-dingemans/ktlint
that referenced
this issue
Apr 2, 2022
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
The rule experimental:function-type-reference-spacing is complaining with Unexpected whitespace for anonymous functions:
val annonymousFunction = fun(inString: String): String? = "Test string"
Observed Behavior
I believe that the anonymous function is properly written and should not complain about unexpected whitespace after the
=
operator. And removing the whitespace after the operator complains about Missing spacing after "="Steps to Reproduce
Running Ktlin check that checks for experimental rules should reproduce this
Your Environment
.editorconfig
settings n/aThe text was updated successfully, but these errors were encountered: