Repository navigation
build: bump kotlin to 2.3.21 and silence DSL marker warning - #355
Conversation
Context overloads no longer win over plain ones, so the nullable runSafeAutomated gets its own name.
|
oops, meant runSafeAutomatedOrNull, not runAutomatedSafeContextOrNull |
|
Yea the naming is a bit weird... I could rename the context one to Made this change ... it touches more files, but I think makes more sense. |
It already has a safe context, so runSafeAutomated goes back to being the nullable one, like runSafe.
|
Im not sure the reason for changing naming? I think the original names worked fine because they described the function explicitly. Calling runAutomated would give the impression that youre creating a new Automated scope but what its really doing is combining SafeContext and Automated |
|
Sorry, I could have been clearer about the why... It's not that the names were bad, it was a change in the way Kotlin resolves method overloads after the version bump (KT-82579). So calls in the code that previously used e.g. Without renaming, you could write So the main options are:
|
|
oof, thats really annoying. I thought it could have been a compiler change but when i reverted the name back to see if there were any issues it didnt show any linting errors. I suppose i just didnt check the call sites. |
|
How about withSafeAutomated? runSafeAutomated is generating and running a new SafeContext, and withSafeAutomated is just combining the two contexts you already have |
It joins the SafeContext and Automated already in scope, where runSafeAutomated makes a new SafeContext.
Description
This is mainly quality of life, getting rid of heaps of warnings in newer IntelliJ versions. It warns about every DSL marker we put on a function. We do it on purpose for the IDE colors... JetBrains says to suppress it (KT-83668). The warning only exists from Kotlin 2.3.20, so we need the bump before we can turn it off.
And... the bump changed how context overloads get picked (KT-82579), so the nullable
runSafeAutomatedis nowrunSafeAutomatedOrNull.