- exception during loading of the definition with maven dependencies
- shading of the gradle script definition (if not fixed by the previous commit)
The discovery files should be restored after fixing/rewriting the discovery
and implementing definition prioritization in IDEA plugin
Use distJar configuration instead.
It's necessary because currently when using default-type, subproject
starts having a transitive dependency to :kotlin-stdlib-common
and that leads to exception from KT-20897 when building light classes
This change might be reverted once KT-23942 is fixed
#KT-23942 Submitted
As far as I can tell (and admittedly I'm not an expert in the Kotlin compiler code), it looks like the new logic iterates over all contributed descriptors, which renders the old logic (which explicitly invokes getCompanionObjectDescriptor) obsolete. We ran into this last year when rebasing on top of https://github.com/JetBrains/kotlin/commit/527ccaff16ecebbfbcecabd5fbc8af808a296915 and - after a quick conversation with @sandwwraith (email chain dated December 12, 2017) - we unblocked ourselves by deleting the old code from our local repository. Now we're looking to upstream our changes, thus this PR.
Old code:
```
// Generate synthetic (non-declared) companion if needed
ClassDescriptor companionObjectDescriptor = descriptor.getCompanionObjectDescriptor();
if (companionObjectDescriptor instanceof SyntheticClassOrObjectDescriptor) {
genSyntheticClassOrObject((SyntheticClassOrObjectDescriptor) companionObjectDescriptor);
}
```
New code:
```
// Generate synthetic nested classes
Collection<DeclarationDescriptor> classifiers = descriptor
.getUnsubstitutedMemberScope()
.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS, MemberScope.Companion.getALL_NAME_FILTER());
for (DeclarationDescriptor memberDescriptor : classifiers) {
if (memberDescriptor instanceof SyntheticClassOrObjectDescriptor) {
genSyntheticClassOrObject((SyntheticClassOrObjectDescriptor) memberDescriptor);
}
}
```
Change-Id: Icb51ee6e56b9928108cc121c78fa50c6354a4b31
When the JavaCompile tasks were removed from a common project, some of
the dependencies on them remained. This could lead to an error during
dependencies resolution, such as the one in KT-23092. To an even greater
confusion, the remaining dependencies anyway led to the task being
added to the task graph.
Issue #KT-23092 Fixed