Is there a way to mark an interface method, so the...
# getting-started
j
Is there a way to mark an interface method, so the IDE would show a warning when calling it, unless suppressed?
m
-you can write a custom rule with whatever linter you're using -Or use @RequiresOptIn https://kotlinlang.org/docs/opt-in-requirements.html
v
Or deprecate it
3
j
Use the opt-in mechanism if the method has reasons to be used in some cases but you want users to consciously opt in because there are implications. Use the deprecation mechanism if there is no reason to use this method ever.
👍 2
j
Thanks! Opt-in is just what I need!
👌 1