From 19aa8cd92b897e2f5c392d74e27f34ae7bab1075 Mon Sep 17 00:00:00 2001 From: Dennis Rieks Date: Mon, 21 Oct 2019 22:34:40 +0200 Subject: [PATCH] fixed NoSuchElementException: List is empty in annotatedDelegationSpecifier --- .../kotlinx/ast/kotlin/summary/Declarations.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kotlin/src/commonMain/kotlin/kotlinx/ast/kotlin/summary/Declarations.kt b/kotlin/src/commonMain/kotlin/kotlinx/ast/kotlin/summary/Declarations.kt index 50f7cab..61a5e42 100644 --- a/kotlin/src/commonMain/kotlin/kotlinx/ast/kotlin/summary/Declarations.kt +++ b/kotlin/src/commonMain/kotlin/kotlinx/ast/kotlin/summary/Declarations.kt @@ -154,12 +154,16 @@ val declarationsMapper: TreeMapMapper = TreeMapMapper() }.map("annotatedDelegationSpecifier") { node: AstNode -> treeMap(node.children).map { summary -> val identifier = summary.filterIsInstance() - TreeMapResult.Continue( - KlassInheritance( - type = identifier.first(), - annotations = summary.filterIsInstance() + if (identifier.size == 1) { + TreeMapResult.Continue( + KlassInheritance( + type = identifier.first(), + annotations = summary.filterIsInstance() + ) ) - ) + } else { + TreeMapResult.Continue(summary) + } } }.map("typeParameter") { node: AstNode -> treeMap(node.children).map { summary ->