I'm facing an issue with warnings regarding contex...
# intellij
d
I'm facing an issue with warnings regarding context receivers which I use in one of my modules of my project. In Intellij only (not when running the build directly via maven) I keep getting the warning
Kotlin: Experimental context receivers are deprecated and will be superseded by context parameters ...
even though the affected module has kotlin explicitly set to 2.0 and this is correctly reflected in Inttelij module settings. Can somebody advice on what I might be missing?
I have tried restting the IDEA project (by deleting the .idea folder) but to no avail.
h
I think that's the expected behavior: Context receivers are deprecated, and a warning is issued from 2.0.20 onwards https://kotlinlang.org/docs/whatsnew2020.html#phased-replacement-of-context-receivers-with-context-parameters
👍 1
d
Yeah, I know about that. But as I said, I have the kotlin version explicitly set to 2.0.0. Besides the build passes through maven.
p
Hello @David Kubecka. The IDE analyzer uses it's own compiler that has a higher version. It knows about the Kotlin version used in the project, but, unfortunately, it does report the diagnostic for versions before 2.0.20 too. Until the migration you can suppress the warning using the compiler flag:
-Xsuppress-warning=CONTEXT_RECEIVERS_DEPRECATED