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 fails to parse angle brackets in certain cases #51
Comments
Since looked through the commit history. It appears this commit addresses the issue highlighted in the first example: 2c17040 |
@myabc thanks! if I understand correctly, it's a matter of releasing a new version? |
@cgrushko I built ktfmt from source and installed it into my local Maven repository. I can confirm that 2c17040 does the trick: ktfmt no longer crashes on calls to
If only... 🙂 AFAICT the second issue I listed is still present on |
Example 1. In the case of a class inheriting from more than one class or interface, angle bracket syntax is used to denote the supertype from which the inherited implementation is taken.Expected behaviour: ktfmt parses/reformats the source code.Actual behaviour: results in an error similar tocom.google.googlejavaformat.FormattingError: 11:15: error: did not generate token "<"
Update: appears to be fixed in 2c17040
Example 2 Type Parameters in Annotations: for example, the
@TypeParceler
annotation from Kotlinx's Parcelize library allows you to explicitly specify an implementation ofParcelable
for types that do not have built-in serialisation support.Expected behaviour: ktfmt parses/reformats the source code.
Actual behaviour: results in an error similar to
com.google.googlejavaformat.FormattingError: 5:21: error: expected token: '('; generated < instead
or5:21: error: expected token: 'data'; generated < instead
if the empty parentheses are removed.Using ktfmt 0.13 with Spotless plugin for Gradle 4.4.0; Gradle 6.5.0. Targeting Kotlin 1.3.72.
The text was updated successfully, but these errors were encountered: