boolean (KtNamedDeclaration declaration) { if (declaration instanceof KtParameter) { PsiElement parent = declaration.getParent(); if (parent instanceof KtParameterList) { parent = parent.getParent(); if (parent instanceof KtPrimaryConstructor) { parent = parent.getParent(); if (parent instanceof KtClass) { return ((KtClass) parent).isData(); } } } } return false; }