Test: arguments of type aliases should be substituted literally,
without type approximation. TYPE_MISMATCH is an expected error.
This commit is contained in:
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
typealias Array2D<T> = Array<Array<T>>
|
||||
|
||||
fun foo(a: Array2D<out Number>) = a
|
||||
|
||||
fun bar(a: Array2D<Int>) {
|
||||
foo(<!TYPE_MISMATCH!>a<!>)
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public typealias Array2D</*0*/ T> = kotlin.Array<kotlin.Array<T>>
|
||||
public fun bar(/*0*/ a: Array2D<kotlin.Int> [= kotlin.Array<kotlin.Array<kotlin.Int>>]): kotlin.Unit
|
||||
public fun foo(/*0*/ a: Array2D<out kotlin.Number> [= kotlin.Array<kotlin.Array<out kotlin.Number>>]): Array2D<out kotlin.Number> [= kotlin.Array<kotlin.Array<out kotlin.Number>>]
|
||||
@@ -19563,6 +19563,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("noApproximationInTypeAliasArgumentSubstitution.kt")
|
||||
public void testNoApproximationInTypeAliasArgumentSubstitution() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("noRHS.kt")
|
||||
public void testNoRHS() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/noRHS.kt");
|
||||
|
||||
Reference in New Issue
Block a user