Skip to content
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

Unexpected exception during call of make macro for higher kinded types #118

Closed
plokhotnyuk opened this issue May 21, 2018 · 0 comments
Closed
Labels

Comments

@plokhotnyuk
Copy link
Owner

Code to reproduce:

import com.github.plokhotnyuk.jsoniter_scala.core._
import com.github.plokhotnyuk.jsoniter_scala.macros._
import scala.language.higherKinds
case class HigherKinded[F[_]](i: Int, hk: F[HigherKinded[F]])
JsonCodecMaker.make[HigherKinded[Option]](CodecMakerConfig())

Exception:

exception during macro expansion: 
scala.ScalaReflectionException: type F is not a class
	at scala.reflect.api.Symbols$SymbolApi.asClass(Symbols.scala:272)
	at scala.reflect.api.Symbols$SymbolApi.asClass$(Symbols.scala:272)
	at scala.reflect.internal.Symbols$SymbolContextApiImpl.asClass(Symbols.scala:94)
	at com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker$Impl$.isValueClass$1(JsonCodecMaker.scala:145)
	at com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker$Impl$.nullValue$1(JsonCodecMaker.scala:483)
	at com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker$Impl$.$anonfun$make$54(JsonCodecMaker.scala:704)
	at scala.collection.immutable.Map$EmptyMap$.getOrElse(Map.scala:101)
	at com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker$Impl$.$anonfun$make$53(JsonCodecMaker.scala:704)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
	at scala.collection.immutable.List.map(List.scala:295)
	at com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker$Impl$.$anonfun$make$39(JsonCodecMaker.scala:702)
	at com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker$Impl$.$anonfun$make$17(JsonCodecMaker.scala:460)
	at scala.collection.mutable.MapLike.getOrElseUpdate(MapLike.scala:206)
	at scala.collection.mutable.MapLike.getOrElseUpdate$(MapLike.scala:203)
	at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:80)
	at com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker$Impl$.withDecoderFor$1(JsonCodecMaker.scala:460)
	at com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker$Impl$.genReadVal$1(JsonCodecMaker.scala:657)
	at com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker$Impl$.make(JsonCodecMaker.scala:947)
	at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers.$anonfun$resolveJavaReflectionRuntime$4(JavaReflectionRuntimes.scala:34)
	at scala.tools.nsc.typechecker.Macros.macroExpandWithRuntime(Macros.scala:803)
@plokhotnyuk plokhotnyuk changed the title Unexpected exception during call of macro for higher kinded types Unexpected exception during call of make macro for higher kinded types May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant