Suppose you have a
Foo<RESULT> interface, and a
class FooA : Foo<Boolean>.
myFoo to be of type
FooA (and thus, of type
Foo<Boolean>), it’d be nice if the compiler could also infer that
RESULT, within the scope of that smart-cast, is of type
Here’s a minimal code-sample. It includes explicit casts; I would love it if the compiler could infer that these casts aren’t necessary, so I could remove them.
Any reason this cast needs to be explicit, or is it just something the compiler doesn’t support (and is it something we could consider supporting in the future)?