-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Exception occurred while executing macro expansion." #971
Comments
A work-around is to move the default value to an
|
Focused reproducer: import play.api.libs.json._
case class Data[T](
data: T,
descr: String
)
def reproducer[T](implicit reads:Reads[T]): Reads[Data[T]] = Json.reads[Data[T]] |
sgodbillon
added a commit
to sgodbillon/play-json
that referenced
this issue
Mar 3, 2024
5 tasks
sgodbillon
added a commit
to sgodbillon/play-json
that referenced
this issue
Mar 4, 2024
cchantep
pushed a commit
that referenced
this issue
Mar 5, 2024
5 tasks
mkurz
added a commit
that referenced
this issue
Apr 29, 2024
[2.10.x] Fix #971 – "Exception occurred while executing macro expansion." (backport #994) by @sgodbillon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Play JSON Version (2.5.x / etc)
2.10.4
API (Scala / Java / Neither / Both)
Scala
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
MacOS 14.2.1
JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)
Library Dependencies
None.
Expected Behavior
I expect to be able to combine a type parameter and a default value in a case class and for Play-Json to be able to automatically derive the appropriate
Reads
andWrites
.Actual Behavior
The compiler throws the following error:
Reproducible Test Case
Place the following in
error.scala
and then run it withscala-cli error.scala
.It contains three examples; remove/replace comments as appropriate for each one.
Example 1: Works as expected, demonstrating use of a type variable,
T
, fordata
.Example 2: Works as expected, demonstrating the use of a default value for
descr
.Example 3: Combines the two above examples, generating a compile-time exception.
The text was updated successfully, but these errors were encountered: