Esempio n. 1
0
  @Nullable
  public static JetClass getClassIfParameterIsProperty(@NotNull JetParameter jetParameter) {
    if (jetParameter.getValOrVarNode() != null) {
      PsiElement parent = jetParameter.getParent();
      if (parent instanceof JetParameterList && parent.getParent() instanceof JetClass) {
        return (JetClass) parent.getParent();
      }
    }

    return null;
  }
Esempio n. 2
0
 public static boolean isFunctionLiteralWithoutDeclaredParameterTypes(
     @Nullable JetExpression expression) {
   if (!(expression instanceof JetFunctionLiteralExpression)) return false;
   JetFunctionLiteralExpression functionLiteral = (JetFunctionLiteralExpression) expression;
   for (JetParameter parameter : functionLiteral.getValueParameters()) {
     if (parameter.getTypeReference() != null) {
       return false;
     }
   }
   return true;
 }