Troubles with PsiElement.replace(PsiElement)

Hello, i was trying to replace specific PsiElement. I use PsiElement.replace(PsiElement) and i get Assert Failed msg, which follows. But nevertheless, the statement was added into my file perfectly.

What am I doing wrong?



and i get:



Please sign in to leave a comment.