mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-02 00:35:33 +07:00
Class.cast(Object) is already externally annotated as "_ -> param1". Were this in the source we would issue a warning, because T is not assignable from Object. Fixes IDEA-229184 @Contract falsely report warning for methods that contain unchecked casts GitOrigin-RevId: 404b103733fcc1d0803222fe2898fde87085383a
14 lines
339 B
Java
14 lines
339 B
Java
import org.jetbrains.annotations.Contract;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
class Foo {
|
|
// IDEA-229184
|
|
@Contract(value = "_ -> param1", pure = true)
|
|
@SuppressWarnings("unchecked")
|
|
public static <T> Option<T> narrow(@NotNull Option<? extends T> option) {
|
|
return ((Option<T>) option);
|
|
}
|
|
|
|
interface Option<T> {}
|
|
}
|