-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Problems with jsoniter compilation after 3.3.1 #19098
Comments
I did not manage to reproduce this one. I get the same failure that is in the details. |
I fixed the ranges in the original comment. |
It might be possible that it's related to #18257 based on |
The missing position was fixed in #18178. |
I have no insight on the |
The compilation crash is still present in the latest 3.5.0-RC1-nightly. The code that triggers the crash is a single test https://github.com/plokhotnyuk/jsoniter-scala/blob/84d57daeada31c0cce2631489e6d7c71e57be37e/jsoniter-scala-macros/shared/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMakerNewTypeSpec.scala#L97-L205 #Edit import scala.collection.mutable
trait JsonValueCodec[T]
trait JsonReader
trait JsonWriter
def verifySerDeser[T](codec: JsonValueCodec[T], obj: T, json: String): Unit = ???
def test(block: => Unit) = ???
def Test = test{
type JsonPrimitive = String | Int | Double | Boolean | None.type
type Rec[JA[_], JO[_], A] = A match { // FIXME: remove this workaround after adding support of recursive types
case JsonPrimitive => JsonPrimitive | JA[Rec[JA, JO, JsonPrimitive]] | JO[Rec[JA, JO, JsonPrimitive]]
case _ => A | JA[Rec[JA, JO, A]] | JO[Rec[JA, JO, A]]
}
type Json = Rec[[A] =>> mutable.Buffer[A], [A] =>> mutable.Map[String, A], JsonPrimitive]
type JsonObject = mutable.Map[String, Json]
type JsonArray = mutable.Buffer[Json]
val jsonCodec: JsonValueCodec[Json] = new JsonValueCodec[Json] {
val nullValue: Json = None
}
def obj(values: (String, Json)*): Json = ???
def arr(values: Json*): Json = mutable.ArrayBuffer[Json](values: _*)
verifySerDeser(
jsonCodec,
arr("VVV", 1.2, true, obj("WWW" -> None, "XXX" -> 777)),
"""["VVV",1.2,true,{"WWW":null,"XXX":777}]"""
)
} |
Compiler version
Everything after 3.3.1.
3.3.2-RC1-bin-20230530-28915c4-NIGHTLY
-3.3.2-RC1-bin-20230630-c629090-NIGHTLY
-xcheck-macros
errorfrom
3.3.2-RC1-bin-20230703-0a21ecf-NIGHTLY
- typer crashReproduction
Output (click arrow to expand)
Up to
3.3.2-RC1-bin-20230630-c629090-NIGHTLY
-xcheck-macros
assertion fail about missing positionFrom
3.3.2-RC1-bin-20230703-0a21ecf-NIGHTLY
:The text was updated successfully, but these errors were encountered: