From 0427adc6d074caeb5644358096be149de6eb48dc Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 2 Mar 2015 18:09:44 +0100 Subject: don't report constructor as undocumented if its containing class is deprecated --- src/Kotlin/DocumentationBuilder.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Kotlin') diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index 0518bb03..ddea6d6e 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -83,9 +83,9 @@ class DocumentationBuilder(val session: ResolveSession, return content } - fun DeclarationDescriptor.isDeprecated() = getAnnotations().any { + fun DeclarationDescriptor.isDeprecated(): Boolean = getAnnotations().any { DescriptorUtils.getFqName(it.getType().getConstructor().getDeclarationDescriptor()).asString() == "kotlin.deprecated" - } + } || (this is ConstructorDescriptor && getContainingDeclaration().isDeprecated()) fun DeclarationDescriptor.signature(): String = when(this) { is ClassDescriptor, is PackageFragmentDescriptor -> DescriptorUtils.getFqName(this).asString() -- cgit