diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-02-14 00:31:47 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-02-17 15:49:57 +0100 |
commit | 8c54b7110a7947ec1694c723499d0b16a9a29ab0 (patch) | |
tree | 78622751d520e1a585ec3897341e592b808c849d /core/src/main/kotlin/transformers | |
parent | c3b798fc31779468d65538b105085a3bd945792f (diff) | |
download | dokka-8c54b7110a7947ec1694c723499d0b16a9a29ab0.tar.gz dokka-8c54b7110a7947ec1694c723499d0b16a9a29ab0.tar.bz2 dokka-8c54b7110a7947ec1694c723499d0b16a9a29ab0.zip |
Fix descriptor visiting, add test for DRI clash on JS
After creating the test reproducing the DRI clash, I found a bug in the DefaultDescriptorToDocumentationTranslator, which this commit fixes. The bug was present when running the tests but not when using dokka on an external project. I have no idea how it worked, as debugging showed that the same code from AbstractClassDescriptor runs in both cases and the code contains an assert, which had to (and did) fail. Probably the error messages are being suppressed somehow. `getMemberScope()` requires a list of type substitutions which size is being compared to the type constructor's parameters count. I suppose we don't want to substitute the type parameters and get the unsubstituted member scope instead
Diffstat (limited to 'core/src/main/kotlin/transformers')
-rw-r--r-- | core/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt b/core/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt index dd2d1681..173e13ac 100644 --- a/core/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt +++ b/core/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt @@ -81,7 +81,7 @@ open class DokkaDescriptorVisitor( fun enumDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): Enum { val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() - val scope = descriptor.getMemberScope(emptyList()) + val scope = descriptor.unsubstitutedMemberScope val descriptorData = descriptor.takeUnless { it.isExpect }?.resolveClassDescriptionData() return Enum( @@ -105,7 +105,7 @@ open class DokkaDescriptorVisitor( fun classDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): Class { val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() - val scope = descriptor.getMemberScope(emptyList()) + val scope = descriptor.unsubstitutedMemberScope val descriptorData = descriptor.takeUnless { it.isExpect }?.resolveClassDescriptionData() val expected = descriptor.takeIf { it.isExpect }?.resolveClassDescriptionData() val actual = listOfNotNull(descriptorData) |