Commit Graph

36 Commits

Author SHA1 Message Date
sebastian.sellmair 4349f98954 [Commonizer] Fix CirConversions and substitute arguments
CirConversions did not cover some potential convertible types.
ClassOrTypeAliasTypeCommonizer did not apply type substitution
for parameterized types coming from a dependency

^KT-48288
2021-09-22 06:45:00 +00:00
sebastian.sellmair 68e7476765 [Commonizer] ClassSuperTypeCommonizer: Don't find consumed TypeNodes
This commit will also add some simple documentation
to this class and its implementation.

^KT-47430
2021-08-16 10:44:04 +00:00
sebastian.sellmair dff392f2cd [Commonizer] ClassSuperTypeCommonizer: Include transitive supertypes
This commit still has some left-over todos that shall be done
in a separate commit.

TODOs:
- CirClassifierIndex is calculated once too often
- Reconsider position of classifierIndices in 'CirKnownClassifiers'
- Add documentation/description to complicated 'ClassSuperTypeCommonizer'
- Add documentation/description to CirSupertypesResolver

^KT-47430 Verification Pending
2021-08-16 10:44:00 +00:00
sebastian.sellmair 8bab6c3076 [Commonizer] Commonize 'val' and 'var' properties
If a setter is not present on all platforms a fallback private setter
shall be emitted.

^KT-47502 Verification Pending
^KT-47691 Verification Pending
2021-07-15 10:04:43 +00:00
sebastian.sellmair f3ff9814a8 [Commonizer] Create approximation keys based on Cir instead of metadata 2021-07-15 10:04:35 +00:00
sebastian.sellmair 5b5dddc2d1 [Commonizer] Restore TypeAliasCommonizer's Commutative property & TypeAliasTypeCommonizer: substitute underlying-type arguments
^KT-47574 The fix done here supports only one level of substituting
underlying type-arguments.

HierarchicalTypeAliasCommonizationTest.`KT-47574 - test long typealias chain`
will assert proper behaviour for nested chains.
2021-07-05 09:00:46 +00:00
sebastian.sellmair 20f55ef0b7 [Commonizer] Commonize 'const val' and 'val' properties 2021-07-05 09:00:42 +00:00
sebastian.sellmair 9794068f22 [Commonizer] typeAliasUtils: computeSuitableUnderlyingType: Consider commonized type-aliases 2021-07-05 09:00:42 +00:00
sebastian.sellmair 8e2780345c [Commonizer] HierarchicalClassAndTypeAliasCommonizationTest: Un-ignore tests fore ^KT-47432 and ^KT-47434 and add additional test's 2021-07-05 09:00:39 +00:00
sebastian.sellmair 21cef41ba5 [Commonizer] AbstractCommonizationFromSourcesTest remove assertions on commonized leaf/platform libraries
Those assertions are not necessary anymore, since the commonizer is not
expected to produce any new "actuals" per given expect.
The IDE is supposed to analyze leaf source sets against the original
platform libraries.
2021-06-23 13:43:37 +00:00
sebastian.sellmair ffcd57cb31 [Commonizer] TypeCommonizer: Support commonizing typeAlias and their underlying types 2021-06-07 09:07:43 +00:00
sebastian.sellmair 8272564ca0 [Commonizer] Prototype: Commonize TypeAliases with Classes
^KT-45992 Fixed
^KT-46061 Fixed
2021-06-07 09:07:40 +00:00
sebastian.sellmair 05a6d89151 [Minor] Re-format :kotlin-klib-commonizer and :kotlin-klib-commonizer-api 2021-04-16 14:56:32 +00:00
Dmitriy Dolovov eddeef1d51 [Commonizer] Build CIR tree directly from metadata 2021-03-09 13:10:01 +03:00
Dmitriy Dolovov 45b17120ad [Commonizer] Minor. Rename: 'dependee' -> 'dependency' 2021-02-16 17:19:49 +03:00
Dmitriy Dolovov 0af31abb04 [Commonizer] Add tests for overloading purely by different upper bounds 2021-02-15 13:25:40 +03:00
Dmitriy Dolovov ee93efc19d [Commonizer] Avoid leaking non-commonized types as arguments in short-circuited TAs 2021-01-15 22:01:56 +03:00
Dmitriy Dolovov b0ff3e7e5e [Commonizer] More fine-grained control of commonized module dependencies
- Reduce usage of 'isUnderStandardKotlinPackages' check in commonizer source code
- Rely on common module dependencies supplied via commonizer Parameters which not only
  Kotlin standard library but may also include common fragments of other libraries
2020-12-03 13:11:27 +03:00
sebastian.sellmair 06cb64bb51 Allow open callable members in expect interfaces
#KT-42094 fixed
2020-11-11 17:41:59 +00:00
Dmitriy Dolovov f5bb60f7cd [Commonizer] Refactor CIR type representation
1. Drop CirClassifierId
2. Specialized classes for each kind of types (classes, TAs, type parameters, flexible types).
3. TypeCommonizer now returns commonized type. In case of TAs this could be a completely new type
   describing expect class or a new TA with the different underlying type.
2020-11-05 18:50:43 +03:00
Dmitriy Dolovov 2764550bbe [Commonizer] Relax conditions for TA lifting-up
Allow lifting up matching TAs with non-empty list of type parameters
and non-empty list of type arguments in the expanded type.
2020-11-05 18:50:37 +03:00
Dmitriy Dolovov c69402c800 [Commonizer] Fix computing underlyingType and expandedType in CirTypeAlias 2020-10-19 11:21:53 +03:00
Dmitriy Dolovov 74dce725cc [Commonizer] Tests for missed supertypes in commonized type aliases
^KT-41247
2020-09-01 13:11:33 +07:00
Dmitriy Dolovov d40bca4143 [Commonizer] Short-circuiting of type aliases
^KT-41220
2020-08-24 12:21:12 +07:00
Dmitriy Dolovov 75be9cf31f [Commonizer] Tests on rewriting callables names to succeed commonization
^KT-34602
2020-08-17 09:31:28 +07:00
Dmitry Savvinov 8890ae10d4 Add test on signatures with nullable abbreviated types
Currently test fails, see KT-40199
2020-07-13 11:50:10 +07:00
Dmitriy Dolovov af1dd6251e [Commonizer] Fallback for const val properties with different values 2020-06-16 15:04:08 +07:00
Dmitriy Dolovov 611946a7c7 [Commonizer] Drop useless annotation tests
^KMM-238
^KMM-53
2020-06-09 11:12:59 +07:00
Dmitriy Dolovov d9bfe11ca1 [Commonizer] Source-based tests on lifting up identical type aliases
^KMM-55
2020-06-09 11:12:45 +07:00
Dmitriy Dolovov 9f31931bb8 [Commonizer] Tests on lifting up identical const properties
^KMM-241
2020-05-28 12:12:39 +07:00
Dmitriy Dolovov e92adf3d4e [Commonizer] Don't preserve annotations on types
This may lead to leakage of specific annotation classes to common module

^KMM-53
2020-05-08 23:52:24 +07:00
Dmitriy Dolovov 5bb5d7f892 [Commonizer] Limited annotation commonization. Tests
^KMM-238
^KMM-53
2020-05-08 23:52:17 +07:00
Dmitriy Dolovov ae570e4acf [Commonizer] Don't filter out @Deprecated non-top-level functions
^KMM-238
2020-05-08 23:51:46 +07:00
Dmitriy Dolovov 9a8a1113db [Commonizer] Don't commonize deprecated functions
1. All functions marked with @Deprecated from Kotlin/Native platform libraries
have DeprecationLevel.ERROR, and therefore practically can not be used by
a developer in their code. So, it does not make sence to keep such
declarations in commonized libraries.

2. Commonization of such functions would also require commonization of
annotations with nested annotations as const values (ex:
@Deprecated(level = DeprecationLevel.ERROR), where both @Deprecated
and DeprecationLevel are annotation classes). This is not implemented yet.
2020-02-18 22:02:38 +07:00
Dmitriy Dolovov 11e0f427ac [Commonizer] Refactor CIR to avoid strong refs on descriptors
This is necessary to reduce memory consumption in commonizer while
processing sets of massive libraries.
Ex: ios_x64 (127 libraries) vs ios_arm64 (127 libraries).
2020-02-18 22:02:29 +07:00
Dmitriy Dolovov 9594b8db42 Rename Kotlin/Native modules for uniformity 2020-01-29 20:30:46 +07:00