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

Incorrect formatting within lambdas for multiplication sign #576

Closed
alexxxdev opened this issue Sep 7, 2019 · 1 comment · Fixed by #598
Closed

Incorrect formatting within lambdas for multiplication sign #576

alexxxdev opened this issue Sep 7, 2019 · 1 comment · Fixed by #598

Comments

@alexxxdev
Copy link

Expected Behavior

Code (shown as an example, only to show an error):

val variable1=2
val variable2=3
val variable3=false
val variable4=variable3.takeIf{variable3}.run{variable1*variable2}

after formatting:

val variable1 = 2
val variable2 = 3
val variable3 = false
val variable4 = variable3.takeIf { variable3 }.run { variable1 * variable2 }

Observed Behavior

val variable1 = 2
val variable2 = 3
val variable3 = false
val variable4 = variable3.takeIf { variable3 }.run { variable1*variable2 }
@christinalee
Copy link

Did a bit of debugging and it looks like this only occurs for multiplication specifically because it's getting caught up in the line designed to ignore spacing for things like fn(*array):

!(node.elementType == MUL && node.isPartOf(KtValueArgument::class)) && // fn(*array)

Will take a look at a solution to more specifically differentiate between fn(*array) and thing.run { thing1*thing2 } cases

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

Successfully merging a pull request may close this issue.

2 participants