# Nulls and generics

**URL:** <https://discuss.kotlinlang.org/t/nulls-and-generics/2219>\
**Category:** Language Design\
**Created:** [January 16, 2017, 6:06am UTC](https://discuss.kotlinlang.org/t/nulls-and-generics/2219 "2017-01-16T06:06:50Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![clubin](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@clubin](https://discuss.kotlinlang.org/u/clubin)\
**Post date:** [January 16, 2017, 7:24am UTC](https://discuss.kotlinlang.org/t/nulls-and-generics/2219/6 "2017-01-16T07:24:57Z")

</div>

> [@clubin](#):
>
> since at the call-site the compiler will actually know what `TReturn` is—since the type of `visitor` will be known

Oh, now I see one of the rabbit holes. It took explicitly writing that above-quoted assumption to notice what one of the challenges to my logic is here: even in my expected treatment of this, the compiler _doesn’t_ necessarily know that the type parameter of the `FooPsiVisitor` used in its first argument `visitor` is the definitive informer of what type `TReturn` is, does it?

D’oh.

(::dreaming:: It would be nice to have a facility to indicate that once such part of a signature is the definitive informer of a type parameter 😮)

---

_[View the full topic](https://discuss.kotlinlang.org/t/nulls-and-generics/2219)._
