How to suppress warnings?


I see the annotation here: And a blog post here:

How do I find out what String to pass to suppress? I tried a couple guesses – no luck.  Alt+Enter doesn’t seem to be working as described in the blog post. It doesn’t give me an option to add the suppress annotation.

Specifically I’m trying to suppress these 2 warnings:
Warning:(75, 25) Kotlin: The corresponding parameter in the supertype ‘ToJsonConverter’ is named ‘x’. This may cause problems when calling this function with named arguments.
Warning:(47, 44) Kotlin: Parameter ‘req’ is never used



If you are in the IDE, press Alt+Enter and navigate to suppression action:


Ah, thanks. I was clicking it, but needed to hit the right arrow instead to show the submenu.



doesn’t work for when expression that is not exhaustive :c


If it’s a ‘when’ expression (as opposed to a statement), then it has to be exhaustive otherwise it won’t compile.

Can’t say I’ve tried to suppress the warning you get if the ‘when’ statement is not exhaustive as I think it’s good practice to make it so in any case.


oh yeah, typo, I meant as a statement. There are simply cases where it does not need to be exhaustive, because it’s only an if-else replacement to handle some cases