I have some Java code like the following snippet (the example is simplified from the original code). A yellow squiggle and warning message appear, as indicated by the code comment below. The message is: "This method invocation is unsafe since the passed arguments may be of a wrong type."
abstract class Seek<T> {
abstract <S> Seek<S> seek(S... o);
abstract <T2> void map(Func<T,T2> call);
interface Func<I,O> {
public O call(I x);
}
public <X2> void go(Func<T,X2> c, T some) {
seek(some).map(c); // <- yellow squiggle here on 'c'
}
}
Why does the warning appear? What is the best way to fix this?
Note: I'm using the AIDE development environment for Android.
EDIT: I fixed an error in the code after reading the answer from @tsolakp and @LouisWasserman.
` instead?– Andy Turner Jul 10 '17 at 19:56