Here’s a very simple generic class in RO C#:
public class TestClass<T>{
public bool test(T value){
return value != null;
}
}
Then after it’s compiled in release mode, I decompile the apk to check the generated java codes:
public class TestClass<T>{
public boolean test(T t) {
return (!(t instanceof Object) ? null : (Object) t) != null;
}
}
Why is there an instanceof operation??
Finally I make a same test in Android Studio and here’s the official compile result:
public class TestClass<T>{
public boolean test(T value){
return value != null;
}
}