Using `.annotations` overwrites previous annotations in Effect v3.17.14, causing issues with iden...

Is it expected that .annotations erases the previously set annotations? We are facing issues because of this when updating effect from v3.17.6 to v3.17.14
Here's a reproduction, with the code below. We can see that the identifier annotation set with Schema.brand is lost when using .annotations after.
import { pipe, Schema, SchemaAST } from "effect"

const schema = pipe(
  Schema.String,
  Schema.brand(Symbol.for("Foo"))
).annotations({
  message: () => ({
    message: `Expected Foo`,
    override: true
  }),
  identifier: "Foo"
})

console.log(SchemaAST.getIdentifierAnnotation(schema.ast)) // finds Foo

const schema2 = pipe(
  Schema.String,
  Schema.brand(Symbol.for("Foo"), {identifier: 'Foo'})
).annotations({
  message: () => ({
    message: `Expected Foo`,
    override: true
  }),
})

console.log(SchemaAST.getIdentifierAnnotation(schema2.ast)) // does not finds Foo

const schema3 = pipe(
  Schema.String,
  Schema.brand(Symbol.for("Foo"), {identifier: 'Foo'})
)

console.log(SchemaAST.getIdentifierAnnotation(schema3.ast)) // finds Foo
Was this page helpful?