-
Notifications
You must be signed in to change notification settings - Fork 77
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
Kotlin 2.0.20-Beta2: Exception when parsing a property accessor #495
Comments
There are tests covering the expected output. Feel free to try removing this stub, it's absolutely a hack. Otherwise, it's probably simple to expand the stub for the new syntax. |
FYI the issue is still there with the release of kotlin 2.0.20 (so its not just kotlin beta) I also wanted to share my slightly code snippet which has the same issue: val Principal.userId: UUID
get() = UUID.fromString(this.name) |
I looked this a bit more, upgrading kotlin version to 2.0.20 in the ktfmt pom.xml also makes a bunch of these tests fails with this exact stacktrace. It seems that I tried replacing |
what did not exist before. |
Returning null from |
#513 passed |
Just for the record, I'm also trying to fix https://youtrack.jetbrains.com/issue/KT-70922. Once it's done, we won't need |
This results in slowdown of ./gradlew ktCheck --rerun from 22s to 82s as we end up creating a lot more classloaders. https://ge.androidx.dev/s/6uo5wcowlhsay/performance/build https://ge.androidx.dev/s/xa5e5cnnd54sw/performance/build This is needed as a workaround for facebook/ktfmt#495 so we can keep using old kotlin compiler for ktfmt as we upgrade to KGP 2.0.20 Test: ./gradlew ktCheck Change-Id: I1220bbef9e679e67d4ab7e0afaf4d4f7be7678d3
Same problem on 2.0.21 |
@WeisSebastian, sounds fair to me. I'll try to get a release out today |
I had to fight 3 SEVs today, so I could not get to this, but I will get this shipped next week |
I've just published https://github.com/facebook/ktfmt/releases/tag/v0.53 Should be available soon to everyone. Thanks for your patience |
I suspect some time will pass until the next spotless version includes the new ktfmt release (last minor was v6.25 in january and there are now multiple betas for v7), so I will just leave this snippet here: configure<SpotlessExtension> {
val ktfmtVersionOverride = "0.53"
if (KtfmtStep.defaultVersion() >= ktfmtVersionOverride) {
throw Exception("Remember to remove explicit version!")
}
kotlin { ktfmt(ktfmtVersionOverride).kotlinlangStyle() }
kotlinGradle { ktfmt(ktfmtVersionOverride).kotlinlangStyle() }
} |
@StefanLobbenmeierObjego isn't it better to the latest using |
Both work, I prefer breaking the build because I want to remove the explicit version when the version finally arrives, so the override only stays in the code for as long as I need it. When renovate / dependabot bumps that version the CI will fail and I will revert that change |
Exception is thrown when parsing the following code:
It appears that
accessor.stub
can benull
with 2.0.20.Full exception:
The text was updated successfully, but these errors were encountered: