Use DefaultAnalyzerFacade for common code in diagnostic tests
Because of incomplete infrastructure, introduce a few dirty hacks to make diagnostic tests analyze the common code via DefaultAnalyzerFacade, and also add common module sources to analysis of platform-specific modules. Also do not render 'platform' declarations from platform-specific modules to the .txt file, since they are very likely to be exact copies of the same declaration in the common module (see RecursiveDescriptorComparator)
This commit is contained in:
+5
@@ -32,6 +32,7 @@ import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.renderer.*;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.MemberComparator;
|
||||
import org.jetbrains.kotlin.resolve.MultiTargetPlatform;
|
||||
import org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope;
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
@@ -204,6 +205,10 @@ public class RecursiveDescriptorComparator {
|
||||
}
|
||||
}
|
||||
|
||||
// 'platform' declarations do not belong to the platform-specific module, even though they participate in the analysis
|
||||
if (descriptor instanceof MemberDescriptor && ((MemberDescriptor) descriptor).isPlatform() &&
|
||||
module.getCapability(MultiTargetPlatform.CAPABILITY) != MultiTargetPlatform.Common.INSTANCE) return false;
|
||||
|
||||
return module.equals(DescriptorUtils.getContainingModule(descriptor));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user