Closed
Description
Compiler version
First fail in 3.3.1-RC1-bin-20230524-5262680-NIGHTLY, working before that
Minimized code
I tried minimizing the code, but the project structure must be influencing it somehow. Error is happening here. If the test is minimized to:
package neotype.zioschema
import neotype.{Newtype, Subtype}
import zio.*
import zio.schema.codec.DecodeError.ReadError
import zio.schema.codec.JsonCodec.JsonDecoder
import zio.schema.codec.JsonCodec.JsonEncoder.charSequenceToByteChunk
import zio.schema.codec.{DecodeError, JsonCodec}
import zio.schema.{DeriveSchema, Schema}
import zio.stream.ZStream
import zio.test.*
import zio.test.Assertion.*
import zio.json.{DeriveJsonEncoder, JsonEncoder}
import zio.json.*
import java.nio.CharBuffer
import java.nio.charset.StandardCharsets
final case class Person(name: String, age: Int, address: String)
object ZioSchemaSpec extends ZIOSpecDefault:
def spec = suite("zioSchemaSpec")(
suite("Person")(
test("parse failure") {
DeriveSchema.gen[Person]
}
)
)
Then the suite is still failing. After extracting it to another scala-cli project, it stops failing.
Output
[error] -- Error: /workspaces/java/neotype/modules/neotype-zio-schema/src/test/scala/neotype/zioschema/ZioSchemaSpec.scala:26:24
[error] 26 | DeriveSchema.gen[Person]
[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:3094)
[error] | at scala.quoted.runtime.impl.QuotesImpl$reflect$Symbol$.newVal(QuotesImpl.scala:2547)
[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] |
[error] |----------------------------------------------------------------------------
[error] |Inline stack trace
[error] |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[error] |This location contains code that was inlined from DeriveSchema.scala:15
[error] ----------------------------------------------------------------------------
Expectation
No failure, as before 3.3.1-RC1-bin-20230524-5262680-NIGHTLY