What are the possible values that can be given to

2020-05-24 20:59发布

问题:

The Kotlin compiler gave me the following warning:

Warning:(399, 1) Kotlin: Expected performance impact of inlining '...' can be insignificant. Inlining works best for functions with lambda parameters

In this case I would like to suppress this warning. I don't know what value to give to @Suppress, however, and I can't find any documentation for what values @Suppress accepts.

What are the possible values that can be given to @Suppress, and what do they mean?

回答1:

IntelliJ gives you nice help here:

Which adds @Suppress("NOTHING_TO_INLINE") to resolve the warning.

Some of the possible names of the compiler diagnostics to suppress can be found in Errors.java and DefaultErrorMessages.java i.e.:

REDUNDANT_MODIFIER, "Modifier ''{0}'' is redundant because ''{1}'' is present"


标签: kotlin