22 fields limit in Scala 2.11 + Play Framework 2.3 Case classes and functions

后端 未结 8 1559
盖世英雄少女心
盖世英雄少女心 2020-12-08 03:05

Scala 2.11 is out and the 22 fields limit for case classes seems to be fixed (Scala Issue, Release Notes).

This has been an issue for me for a while because I use ca

8条回答
  •  执笔经年
    2020-12-08 03:22

    I tried Shapeless "Automatic Typeclass Derivation" based solution proposed in another answer, and it didn't work for our models - was throwing StackOverflow exceptions (case class with ~30 fields and 4 nested collections of case classes with 4-10 fields).

    So, we've adopted this solution and it worked flawlessly. Confirmed that by writing ScalaCheck test. Notice, that it requires Play Json 2.4.

提交回复
热议问题