Skip to content

Compilation fails due to assertion in scala.quoted.runtime.impl.QuotesImpl$reflect$Symbol$.newVal #17432

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

Closed
WojciechMazur opened this issue May 8, 2023 · 2 comments · Fixed by #17437
Assignees
Labels
area:metaprogramming:quotes Issues related to quotes and splices itype:bug itype:crash regression This worked in a previous version but doesn't anymore

Comments

@WojciechMazur
Copy link
Contributor

Compiler version

3.3.1-RC1-bin-20230504-0e00420-NIGHTLY

Found in Open Community build in following projects:

Projects with last successful builds using Scala �[1m3.3.1-RC1-bin-20230427-f128063-NIGHTLY�[0m [16]:

Project Version Build URL Notes
carlos-verdes/zio-arangodb 0.2.2 Open CB logs
lambdaworks/zio-elasticsearch 0.1.0 Open CB logs
vigoo/desert 0.3.3 Open CB logs
yakivy/jam 0.3.0 Open CB logs
zio/zio-openai 0.2.0 -> 0.2.1 Open CB logs

Output

Error:  -- Error: /build/repo/arangodb-http/src/main/scala/io/funkode/arangodb/http/SchemaCodecs.scala:21:46 
Error:  21 |  given Schema[ArangoError] = DeriveSchema.gen[ArangoError]
Error:     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error:     |Exception occurred while executing macro expansion.
Error:     |java.lang.AssertionError: assertion failed: privateWithin must be a type symbol or `Symbol.noSymbol`
Error:     |	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$reflect$Symbol$.newVal(QuotesImpl.scala:2547)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$reflect$Symbol$.newVal(QuotesImpl.scala:2546)
Error:     |	at zio.schema.DeriveSchema.deriveCaseClass(DeriveSchema.scala:153)
Error:     |	at zio.schema.DeriveSchema.deriveSchema(DeriveSchema.scala:94)
Error:     |	at zio.schema.DeriveSchema$.deriveSchema(DeriveSchema.scala:18)
Error:     |	at zio.schema.DeriveSchema$.inline$deriveSchema(DeriveSchema.scala:17)
Error:     |```
@WojciechMazur WojciechMazur added itype:bug itype:crash stat:needs minimization Needs a self contained minimization regression This worked in a previous version but doesn't anymore stat:needs triage Every issue needs to have an "area" and "itype" label labels May 8, 2023
@sjrd
Copy link
Member

sjrd commented May 8, 2023

That's an intentional big fix. The macros that try to use a term symbol there are wrong. And that has actually shown in published artifacts that contain invalid tasty that tasty-query cannot read.

@mbovel mbovel added area:metaprogramming:quotes Issues related to quotes and splices and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 8, 2023
@KacperFKorban
Copy link
Member

KacperFKorban commented May 8, 2023

I made a PR to zio-schema that should fix all the errors EXCEPT for yakivy/jam.
zio-schema PR: zio/zio-schema#555

yakivy/jam seems to be a different issue:

Error:  -- Error: /build/repo/core/test/src/jam/CoreSpec.scala:102:28 ------------------
Error:  102 |                    val d = jam.brewWith(new WithCustomConstructors(_: WithSingleArg))
Error:      |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error:      |Exception occurred while executing macro expansion.
Error:      |java.util.NoSuchElementException: head of empty list
Error:      |	at scala.collection.immutable.Nil$.head(List.scala:662)
Error:      |	at scala.collection.immutable.Nil$.head(List.scala:661)
Error:      |	at jam.core.JamCoreMacro$.createResultFromFunction(JamCoreMacro.scala:172)
Error:      |	at jam.core.JamCoreMacro$.brewFromWithImpl$$anonfun$2(JamCoreMacro.scala:32)
Error:      |	at jam.core.JamCoreMacro$.brew(JamCoreMacro.scala:254)
Error:      |	at jam.core.JamCoreMacro$.brewFromWithImpl(JamCoreMacro.scala:33)
Error:      |	at jam.core.JamCoreMacro$.brewWithImpl(JamCoreMacro.scala:23)

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 9, 2023
@nicolasstucki nicolasstucki removed the stat:needs minimization Needs a self contained minimization label May 9, 2023
@nicolasstucki nicolasstucki self-assigned this May 9, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 9, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 9, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metaprogramming:quotes Issues related to quotes and splices itype:bug itype:crash regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants