Type parameters for type alias constructor are declared type parameters for type alias
(no implicit type parameters from containing scopes).
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||||
|
|
||||||
|
class Cell<TC>(val x: TC)
|
||||||
|
|
||||||
|
fun <T> id(x: T): T {
|
||||||
|
typealias C = Cell<T>
|
||||||
|
class Local(val cell: C)
|
||||||
|
val cx = C(x)
|
||||||
|
val c: C = Local(cx).cell
|
||||||
|
return c.x
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun </*0*/ T> id(/*0*/ x: T): T
|
||||||
|
|
||||||
|
public final class Cell</*0*/ TC> {
|
||||||
|
public constructor Cell</*0*/ TC>(/*0*/ x: TC)
|
||||||
|
public final val x: TC
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
@@ -19539,6 +19539,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("localTypeAliasConstructor.kt")
|
||||||
|
public void testLocalTypeAliasConstructor() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/localTypeAliasConstructor.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/nested.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/nested.kt");
|
||||||
|
|||||||
+1
-1
@@ -95,7 +95,7 @@ class TypeAliasConstructorDescriptorImpl private constructor(
|
|||||||
FunctionDescriptorImpl.getSubstitutedValueParameters(typeAliasConstructor, valueParameters, substitutor, false)
|
FunctionDescriptorImpl.getSubstitutedValueParameters(typeAliasConstructor, valueParameters, substitutor, false)
|
||||||
?: return null
|
?: return null
|
||||||
|
|
||||||
typeAliasConstructor.initialize(valueParameters, visibility, typeAliasDescriptor.typeConstructor.parameters)
|
typeAliasConstructor.initialize(valueParameters, visibility, typeAliasDescriptor.declaredTypeParameters)
|
||||||
|
|
||||||
typeAliasConstructor.returnType = substitutor.substitute(returnType, Variance.OUT_VARIANCE) ?: return null
|
typeAliasConstructor.returnType = substitutor.substitute(returnType, Variance.OUT_VARIANCE) ?: return null
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user