adam-mcneilly
05/02/2018, 2:30 PMfun <T : Any?> T.isNullOrEqualTo(t : T): Boolean {
return this == null || this == t
}
However it compiles totally fine if they're different types (even though it returns false). Like 3.equals("Pickles")
compiles, even if it's not valid. Is there any way to enforce that the two types are the same, without writing a bunch of type safe versions of this?