Gopal S Akshintala
05/20/2021, 1:25 PMorg.jetbrains.annotations.NotNull
doesn’t work on Generic param types 😞
fun someFun(list: List<@NotNull String>)
Alexey Belkov [JB]
05/20/2021, 2:02 PMGopal S Akshintala
05/20/2021, 3:30 PMtestCompileOnly("org.jetbrains:annotations:20.1.0")
It now works without an exception, but I see no warning or runtimeexception when I did this. Aren’t these annotations supposed to help IDE at compile time?
@Test
void notNull() {
//someFun(null);
var list = new ArrayList<String>();
list.add("");
list.add(null);
NotNullKt.someFun(list);
}
Gopal S Akshintala
05/20/2021, 3:30 PMfun someFun(list: List<@NotNull String>) {
list.map { println(it) }
}
Gopal S Akshintala
05/20/2021, 3:33 PMGopal S Akshintala
05/20/2021, 3:44 PMAlexey Belkov [JB]
05/25/2021, 11:02 AMGopal S Akshintala
05/25/2021, 11:04 AM