[Commonizer] Source-based tests on lifting up identical type aliases
^KMM-55
This commit is contained in:
Vendored
+25
-2
@@ -1,2 +1,25 @@
|
||||
expect class A ()
|
||||
expect class B
|
||||
expect class A()
|
||||
|
||||
// Lifted up type aliases:
|
||||
typealias B = A // class at the RHS
|
||||
typealias C = B // TA at the RHS
|
||||
|
||||
typealias F = List<String> // parameterized type at the RHS
|
||||
typealias H<T> = List<T> // TA with own parameters
|
||||
|
||||
typealias J<T> = Function<T> // function type at the RHS
|
||||
typealias M = () -> Unit // same return type
|
||||
typealias O = (String) -> Int // same argument type
|
||||
|
||||
typealias Q<T> = (List<M>) -> Map<T, O> // something complex
|
||||
typealias R = Function<C> // something complex
|
||||
|
||||
// Type aliases converted to expect classes:
|
||||
typealias S = String
|
||||
expect class T
|
||||
|
||||
// Nullability:
|
||||
typealias U = A // same nullability of the RHS class
|
||||
expect class V // different nullability of the RHS class
|
||||
typealias W = U // same nullability of the RHS TA
|
||||
typealias Y = V // TA at the RHS with the different nullability of own RHS
|
||||
|
||||
Vendored
+20
-7
@@ -1,8 +1,21 @@
|
||||
actual class A actual constructor()
|
||||
actual typealias B = A
|
||||
typealias C = B
|
||||
typealias D = List<String>
|
||||
typealias E<T> = List<T>
|
||||
typealias F<R> = Function<R>
|
||||
typealias G = () -> Unit
|
||||
typealias H = (String) -> Int
|
||||
|
||||
// Lifted up type aliases:
|
||||
typealias D = B // class/TA at the RHS
|
||||
typealias E = C // different TAs at the RHS
|
||||
|
||||
typealias G = List<Int> // different parameterized types at the RHS
|
||||
|
||||
typealias I<T> = List<T> // TAs with own parameters with different names
|
||||
|
||||
typealias K<T> = Function<T> // function types with different type parameter names
|
||||
typealias L<T> = () -> T // different kinds of function types
|
||||
typealias N = () -> Any // different return types
|
||||
typealias P = (Int) -> Int // different argument types
|
||||
|
||||
// Type aliases converted to expect classes:
|
||||
actual typealias T = Int
|
||||
|
||||
// Nullability:
|
||||
actual typealias V = A? // different nullability of the RHS class
|
||||
typealias X = U? // different nullability of the RHS TA
|
||||
|
||||
Vendored
+20
-7
@@ -1,8 +1,21 @@
|
||||
actual class A actual constructor()
|
||||
actual typealias B = A
|
||||
typealias C = B
|
||||
typealias D = List<String>
|
||||
typealias E<T> = List<T>
|
||||
typealias F<R> = Function<R>
|
||||
typealias G = () -> Unit
|
||||
typealias H = (String) -> Int
|
||||
|
||||
// Lifted up type aliases:
|
||||
typealias D = A // class/TA at the RHS
|
||||
typealias E = B // different TAs at the RHS
|
||||
|
||||
typealias G = List<String> // different parameterized types at the RHS
|
||||
|
||||
typealias I<R> = List<R> // TAs with own parameters with different names
|
||||
|
||||
typealias K<R> = Function<R> // function types with different type parameter names
|
||||
typealias L<T> = Function<T> // different kinds of function types
|
||||
typealias N = () -> Unit // different return types
|
||||
typealias P = (String) -> Int // different argument types
|
||||
|
||||
// Type aliases converted to expect classes:
|
||||
actual typealias T = String
|
||||
|
||||
// Nullability:
|
||||
actual typealias V = A // different nullability of the RHS class
|
||||
typealias X = U // different nullability of the RHS TA
|
||||
|
||||
+35
-7
@@ -1,8 +1,36 @@
|
||||
class A
|
||||
typealias B = A
|
||||
typealias C = B
|
||||
typealias D = List<String>
|
||||
typealias E<T> = List<T>
|
||||
typealias F<R> = Function<R>
|
||||
typealias G = () -> Unit
|
||||
typealias H = (String) -> Int
|
||||
|
||||
// Lifted up type aliases:
|
||||
typealias B = A // class at the RHS
|
||||
typealias C = B // TA at the RHS
|
||||
|
||||
typealias D = B // class/TA at the RHS
|
||||
typealias E = C // different TAs at the RHS
|
||||
|
||||
typealias F = List<String> // parameterized type at the RHS
|
||||
typealias G = List<Int> // different parameterized types at the RHS
|
||||
|
||||
typealias H<T> = List<T> // TA with own parameters
|
||||
typealias I<T> = List<T> // TAs with own parameters with different names
|
||||
|
||||
typealias J<T> = Function<T> // function type at the RHS
|
||||
typealias K<T> = Function<T> // function types with different type parameter names
|
||||
typealias L<T> = () -> T // different kinds of function types
|
||||
typealias M = () -> Unit // same return type
|
||||
typealias N = () -> Any // different return types
|
||||
typealias O = (String) -> Int // same argument type
|
||||
typealias P = (Int) -> Int // different argument types
|
||||
|
||||
typealias Q<T> = (List<M>) -> Map<T, O> // something complex
|
||||
typealias R = Function<C> // something complex
|
||||
|
||||
// Type aliases converted to expect classes:
|
||||
typealias S = String
|
||||
typealias T = Int
|
||||
|
||||
// Nullability:
|
||||
typealias U = A // same nullability of the RHS class
|
||||
typealias V = A? // different nullability of the RHS class
|
||||
typealias W = U // same nullability of the RHS TA
|
||||
typealias X = U? // different nullability of the RHS TA
|
||||
typealias Y = V // TA at the RHS with the different nullability of own RHS
|
||||
|
||||
Vendored
+35
-7
@@ -1,8 +1,36 @@
|
||||
class A
|
||||
typealias B = A
|
||||
typealias C = B
|
||||
typealias D = List<String>
|
||||
typealias E<T> = List<T>
|
||||
typealias F<R> = Function<R>
|
||||
typealias G = () -> Unit
|
||||
typealias H = (String) -> Int
|
||||
|
||||
// Lifted up type aliases:
|
||||
typealias B = A // class at the RHS
|
||||
typealias C = B // TA at the RHS
|
||||
|
||||
typealias D = A // class/TA at the RHS
|
||||
typealias E = B // different TAs at the RHS
|
||||
|
||||
typealias F = List<String> // parameterized type at the RHS
|
||||
typealias G = List<String> // different parameterized types at the RHS
|
||||
|
||||
typealias H<T> = List<T> // TA with own parameters
|
||||
typealias I<R> = List<R> // TAs with own parameters with different names
|
||||
|
||||
typealias J<T> = Function<T> // function type at the RHS
|
||||
typealias K<R> = Function<R> // function types with different type parameter names
|
||||
typealias L<T> = Function<T> // different kinds of function types
|
||||
typealias M = () -> Unit // same return type
|
||||
typealias N = () -> Unit // different return types
|
||||
typealias O = (String) -> Int // same argument type
|
||||
typealias P = (String) -> Int // different argument types
|
||||
|
||||
typealias Q<T> = (List<M>) -> Map<T, O> // something complex
|
||||
typealias R = Function<C> // something complex
|
||||
|
||||
// Type aliases converted to expect classes:
|
||||
typealias S = String
|
||||
typealias T = String
|
||||
|
||||
// Nullability:
|
||||
typealias U = A // same nullability of the RHS class
|
||||
typealias V = A // different nullability of the RHS class
|
||||
typealias W = U // same nullability of the RHS TA
|
||||
typealias X = U // different nullability of the RHS TA
|
||||
typealias Y = V // TA at the RHS with the different nullability of own RHS
|
||||
|
||||
Vendored
+16
-15
@@ -1,20 +1,21 @@
|
||||
expect public class A1()
|
||||
expect protected class B1()
|
||||
expect internal class C1()
|
||||
public expect class A1()
|
||||
protected expect class B1()
|
||||
internal expect class C1()
|
||||
|
||||
expect public class E1
|
||||
expect protected class E2
|
||||
expect internal class E3
|
||||
expect private class E4
|
||||
public typealias E1 = A1
|
||||
protected typealias E2 = A1
|
||||
internal typealias E3 = A1
|
||||
public expect class E4
|
||||
|
||||
expect protected class F1
|
||||
expect private class F3
|
||||
protected typealias F1 = A1
|
||||
public expect class F2
|
||||
public expect class F3
|
||||
|
||||
expect internal class G1
|
||||
expect private class G2
|
||||
internal typealias G1 = A1
|
||||
public expect class G2
|
||||
|
||||
expect private class H1
|
||||
public expect class H1
|
||||
|
||||
expect public class I1
|
||||
expect public class I2
|
||||
expect public class I3
|
||||
public typealias I1 = A1
|
||||
public typealias I2 = B1
|
||||
public typealias I3 = C1
|
||||
|
||||
Vendored
+9
-17
@@ -1,32 +1,24 @@
|
||||
actual public class A1 actual constructor()
|
||||
public actual class A1 actual constructor()
|
||||
public class A2
|
||||
public class A3
|
||||
public class A4
|
||||
|
||||
actual protected class B1 actual constructor()
|
||||
protected actual class B1 actual constructor()
|
||||
protected class B2
|
||||
protected class B3
|
||||
|
||||
actual internal class C1 actual constructor()
|
||||
internal actual class C1 actual constructor()
|
||||
internal class C2
|
||||
|
||||
private class D1
|
||||
|
||||
actual public typealias E1 = A1
|
||||
actual public typealias E2 = A1
|
||||
actual public typealias E3 = A1
|
||||
actual public typealias E4 = A1
|
||||
public actual typealias E4 = A1
|
||||
|
||||
actual protected typealias F1 = A1
|
||||
protected typealias F2 = A1
|
||||
actual protected typealias F3 = A1
|
||||
protected actual typealias F2 = A1
|
||||
protected actual typealias F3 = A1
|
||||
|
||||
actual internal typealias G1 = A1
|
||||
actual internal typealias G2 = A1
|
||||
internal actual typealias G2 = A1
|
||||
|
||||
actual private typealias H1 = A1
|
||||
private actual typealias H1 = A1
|
||||
|
||||
actual public typealias I1 = A1 // points to public
|
||||
actual public typealias I2 = B1 // points to protected
|
||||
actual public typealias I3 = C1 // points to internal
|
||||
public typealias I4 = D1 // points to private
|
||||
typealias I4 = D1
|
||||
|
||||
Vendored
+9
-17
@@ -1,32 +1,24 @@
|
||||
actual public class A1 actual constructor()
|
||||
public actual class A1 actual constructor()
|
||||
protected class A2
|
||||
internal class A3
|
||||
private class A4
|
||||
|
||||
actual protected class B1 actual constructor()
|
||||
protected actual class B1 actual constructor()
|
||||
internal class B2
|
||||
private class B3
|
||||
|
||||
actual internal class C1 actual constructor()
|
||||
internal actual class C1 actual constructor()
|
||||
private class C2
|
||||
|
||||
private class D1
|
||||
|
||||
actual public typealias E1 = A1
|
||||
actual protected typealias E2 = A1
|
||||
actual internal typealias E3 = A1
|
||||
actual private typealias E4 = A1
|
||||
private actual typealias E4 = A1
|
||||
|
||||
actual protected typealias F1 = A1
|
||||
internal typealias F2 = A1
|
||||
actual private typealias F3 = A1
|
||||
internal actual typealias F2 = A1
|
||||
private actual typealias F3 = A1
|
||||
|
||||
actual internal typealias G1 = A1
|
||||
actual private typealias G2 = A1
|
||||
private actual typealias G2 = A1
|
||||
|
||||
actual private typealias H1 = A1
|
||||
private actual typealias H1 = A1
|
||||
|
||||
actual public typealias I1 = A1 // points to public
|
||||
actual public typealias I2 = B1 // points to protected
|
||||
actual public typealias I3 = C1 // points to internal
|
||||
public typealias I4 = D1 // points to private
|
||||
typealias I4 = D1
|
||||
|
||||
Reference in New Issue
Block a user