class Out class X // Why we want this to be translated to 'Out> f()' instead of 'Out> f()' // There are two instantiations of 'In' in this test: outer Out<...> and inner Out // So why do we want to put a wildcard on the inner one and not the outer? // People don't want wildcards in return types, because they are _long_. So we try our best to remove wildcards where possible // Not putting a wildcard on the outer occurrence is not imposing a restriction, actually it is removing one: // anything that can be done with Out in Java can be done with Out // But omitting the wildcard on the inner occurrence is restrictive: // one can add a List to a List>, // but not to a List>, // thus removing the wildcard would be restricting the use of the return value of the method, and we don't want do this. fun f(): Out> = throw Exception() // method: _DefaultPackage::f // jvm signature: ()LOut; // generic signature: ()LOut;>;