@@ -2605,8 +2605,8 @@ const getDefaultTypeLiteralAST = <
26052605 } )
26062606 }
26072607 return new AST . Transformation (
2608- new AST . TypeLiteral ( from , issFrom , { [ AST . TitleAnnotationId ] : "Struct (Encoded side)" } ) ,
2609- new AST . TypeLiteral ( to , issTo , { [ AST . TitleAnnotationId ] : "Struct (Type side)" } ) ,
2608+ new AST . TypeLiteral ( from , issFrom , { [ AST . AutoTitleAnnotationId ] : "Struct (Encoded side)" } ) ,
2609+ new AST . TypeLiteral ( to , issTo , { [ AST . AutoTitleAnnotationId ] : "Struct (Type side)" } ) ,
26102610 new AST . TypeLiteralTransformation ( transformations )
26112611 )
26122612 }
@@ -8100,15 +8100,6 @@ const extendFields = (a: Struct.Fields, b: Struct.Fields): Struct.Fields => {
81008100 return out
81018101}
81028102
8103- // does not overwrite existing title annotation
8104- const orElseTitleAnnotation = <A, I, R>(schema: Schema<A, I, R>, title: string): Schema<A, I, R> => {
8105- const annotation = AST.getTitleAnnotation(schema.ast)
8106- if (option_.isNone(annotation)) {
8107- return schema.annotations({ title })
8108- }
8109- return schema
8110- }
8111-
81128103type MakeOptions = boolean | {
81138104 readonly disableValidation?: boolean
81148105}
@@ -8128,9 +8119,9 @@ const makeClass = ({ Base, annotations, disableToString, fields, identifier, kin
81288119 disableToString?: boolean | undefined
81298120}): any => {
81308121 const classSymbol = Symbol.for(` effect / Schema / $ { kind} / $ { identifier } `)
8131- const validateSchema = orElseTitleAnnotation( schema, ` $ { identifier } ( Constructor ) `)
8132- const encodedSide: Schema.Any = orElseTitleAnnotation( schema, ` $ { identifier } ( Encoded side ) `)
8133- const typeSide = orElseTitleAnnotation( typeSchema(schema), ` $ { identifier } ( Type side ) `)
8122+ const validateSchema = schema.annotations({ [AST.AutoTitleAnnotationId]: ` $ { identifier } ( Constructor ) ` } )
8123+ const encodedSide: Schema.Any = schema.annotations({ [AST.AutoTitleAnnotationId]: ` $ { identifier } ( Encoded side ) ` } )
8124+ const typeSide = typeSchema(schema).annotations({ [AST.AutoTitleAnnotationId]: ` $ { identifier } ( Type side ) ` } )
81348125 const fallbackInstanceOf = (u: unknown) => Predicate.hasProperty(u, classSymbol) && ParseResult.is(typeSide)(u)
81358126 const klass = class extends Base {
81368127 constructor(
0 commit comments