Skip to content
Playground(another site)

bynk.types.field_name_duplicate

Error A field has more than one @name, or two fields of a request record read the same wire name.

A field's wire name is the key a request reader looks it up by, so two fields of one record cannot share one: both would read the same value. A field's wire name is its @name, or its own name when it has none. A field may also carry only one @name. Give each field its own key. Names differing only in case are bynk.types.field_name_case_conflict.

Example

type Filter = {
@name("page") a: Option[Int],
page: Option[Int], // ✗ reads `page` again
}
type Filter = {
@name("page") a: Option[Int],
size: Option[Int], // ✓
}

In the Book

See also

  • The grammar rule it governs: record_field.
  • Every code in its category, Type checking, on the diagnostic index.
  • bynk explain bynk.types.field_name_duplicate shows the same from the installed toolchain, without a network.