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

ktfmt breaks kotlin-compiler when using @Suppress #247

Closed
reemhGoogle opened this issue Jul 21, 2021 · 0 comments
Closed

ktfmt breaks kotlin-compiler when using @Suppress #247

reemhGoogle opened this issue Jul 21, 2021 · 0 comments

Comments

@reemhGoogle
Copy link

source code before ktfmt:

var state = State.NOTHING
fun restore(bundle: Bundle) {
  @Suppress("UNCHECKED_CAST") 
  state = bundle.getSerializable(KEY_STATE) as State
}

source code after ktfmt:

var state = State.NOTHING
fun restore(bundle: Bundle) {
  @Suppress("UNCHECKED_CAST")  state = bundle.getSerializable(KEY_STATE) as State
}

trying to compile and run the code, we get:

Task :app:compileLiteDebugKotlin FAILED
e: warnings found and -Werror specified
w: /***/**/*****/***/*****/*****/MyFile.kt: (83, 5): Annotations on block-level expressions are being parsed differently depending on presence of a new line after them. Use new line if whole block-level expression must be annotated or wrap annotated expression in parentheses
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.

1 participant