Is it possible to do something like [this](https://stackoverflow.com/questions/15430701/using-a-nested-type-parameter-as-a-toplevel-type-parameter) in TypeScript?

If not, is there a formal explanation as to why the compiler can't infer nested type parameters?

Here's an example of what I'm trying to achieve:

```ts
interface TestFilter {
    name?: string;
}

interface FilterComponent<F> {
    setFilter(filter: F)
}

class TestFilterComponent implements FilterComponent<TestFilter> {
    private filter: TestFilter;

    setFilter(filter: TestFilter) {
        this.filter = filter;
    }
}

// Can I use F without declaring it as another type parameter?
// Something like: class FilterWrapperComponent<FC extends FilterComponent<F>>
abstract class FilterWrapperComponent<F, FC extends FilterComponent<F>> {
    private sidebarFilter: FC;
    private modalFilter: FC;

    public passFilter(filter: F) {
        this.sidebarFilter.setFilter(filter);
        this.modalFilter.setFilter(filter);
    }
}

// I want to just write "extends FilterWrapperComponent<TestFilterComponent>"
// and get TestFilter as F automatically
class TestFilterWrapperComponent extends FilterWrapperComponent<TestFilter, TestFilterComponent> {

}

```

Also available on [playground](http://www.typescriptlang.org/play/index.html#src=interface%20TestFilter%20%7B%0D%0A%20%20%20%20name%3F%3A%20string%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20FilterComponent%3CF%3E%20%7B%0D%0A%20%20%20%20setFilter(filter%3A%20F)%0D%0A%7D%0D%0A%0D%0Aclass%20TestFilterComponent%20implements%20FilterComponent%3CTestFilter%3E%20%7B%0D%0A%20%20%20%20private%20filter%3A%20TestFilter%3B%0D%0A%0D%0A%20%20%20%20setFilter(filter%3A%20TestFilter)%20%7B%0D%0A%20%20%20%20%20%20%20%20this.filter%20%3D%20filter%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0A%2F%2F%20Can%20I%20use%20F%20without%20declaring%20it%20as%20another%20type%20parameter%3F%0D%0A%2F%2F%20Something%20like%3A%20class%20FilterWrapperComponent%3CFC%20extends%20FilterComponent%3CF%3E%3E%0D%0Aabstract%20class%20FilterWrapperComponent%3CF%2C%20FC%20extends%20FilterComponent%3CF%3E%3E%20%7B%0D%0A%20%20%20%20private%20sidebarFilter%3A%20FC%3B%0D%0A%20%20%20%20private%20modalFilter%3A%20FC%3B%0D%0A%0D%0A%20%20%20%20public%20passFilter(filter%3A%20F)%20%7B%0D%0A%20%20%20%20%20%20%20%20this.sidebarFilter.setFilter(filter)%3B%0D%0A%20%20%20%20%20%20%20%20this.modalFilter.setFilter(filter)%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0A%2F%2F%20I%20want%20to%20just%20write%20%22extends%20FilterWrapperComponent%3CTestFilterComponent%3E%22%0D%0A%2F%2F%20and%20get%20TestFilter%20as%20F%20automatically%0D%0Aclass%20TestFilterWrapperComponent%20extends%20FilterWrapperComponent%3CTestFilter%2C%20TestFilterComponent%3E%20%7B%0D%0A%20%20%20%20%0D%0A%7D).