Files
Tagir Valeevandintellij-monorepo-bot 0dca84fdec IDEA-224654 False-Negative Contract evaluation
GitOrigin-RevId: 9ee1fddcd636a1f8a75d11011d1d1f8b75c93d7a
2019-10-16 06:01:36 +00:00

9 lines
198 B
Java

import org.jetbrains.annotations.Contract;
class Foo {
@Contract("_, null -> fail")
static <T, R extends T> boolean canCast(T inst, Class<R> toType) {
return toType.isInstance(inst);
}
}