Type inference SHOULD NOT work for type alias constructor in supertypes list
(same as for classes: type arguments should be provided explicitly).
This commit is contained in:
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
open class Ref<T>(var x: T)
|
||||||
|
|
||||||
|
typealias R<T> = Ref<T>
|
||||||
|
|
||||||
|
// Type inference SHOULD NOT work for type alias constructor in supertypes list
|
||||||
|
class Test1 : <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>R<!>(0)
|
||||||
|
class Test2 : R<Int>(0)
|
||||||
Vendored
+25
@@ -0,0 +1,25 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public open class Ref</*0*/ T> {
|
||||||
|
public constructor Ref</*0*/ T>(/*0*/ x: T)
|
||||||
|
public final var x: T
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class Test1 {
|
||||||
|
public constructor Test1()
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class Test2 : R<kotlin.Int> /* = Ref<kotlin.Int> */ {
|
||||||
|
public constructor Test2()
|
||||||
|
public final override /*1*/ /*fake_override*/ var x: kotlin.Int
|
||||||
|
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
|
||||||
|
}
|
||||||
|
public typealias R</*0*/ T> = Ref<T>
|
||||||
@@ -21154,6 +21154,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeAliasConstructorInferenceInSupertypesList.kt")
|
||||||
|
public void testTypeAliasConstructorInferenceInSupertypesList() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasConstructorInferenceInSupertypesList.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("typeAliasConstructorTypeArgumentsInference.kt")
|
@TestMetadata("typeAliasConstructorTypeArgumentsInference.kt")
|
||||||
public void testTypeAliasConstructorTypeArgumentsInference() throws Exception {
|
public void testTypeAliasConstructorTypeArgumentsInference() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user