コメントがスレッド化されたブログ投稿のテンプレートを作成しています。スレッド化されたコメントのテンプレートを作成する自然な方法は、Html の構築に再帰的な方法を使用します。このようなもの:
@showComment(comment: models.Comment) = {
    <div class="comment">
        <div class="comment-metadata">
            <span class="comment-author">by @comment.author,</span>
            <span class="comment-date">
                @comment.postedAt.format("dd MMM yy")
            </span>
        </div>
        <div class="comment-content">
            <div class="about">Detail: </div>
            @Html(comment.content.replace("\n", "<br>"))
        </div>
        <a href="@action(controllers.Application.replyComment(comment.id()))">Reply</a>
        @comments filter { c => c.parent_id == comment.id } map { 
            c => @showComment(c)
        }
    </div>
}
問題は、再帰ブロックを使用するとエラーが発生することです。
発生したエラー: 再帰メソッド showComment には結果タイプが必要です
showComment に戻り値の型を入れようとすると、次のエラーが発生します。
発生したエラー: 見つかりません: 値 showComment
回避策はありますか?