---
source: compiler-core/src/type_/tests.rs
expression: "\npub type Thingy {\n  A(a: Int)\n  B(x: Int, b: Int)\n}\n\npub fn fun(x) {\n  case x {\n    A(..) -> x.a\n    B(..) -> x.b\n  }\n  x.b\n}\n"
---
----- SOURCE CODE

pub type Thingy {
  A(a: Int)
  B(x: Int, b: Int)
}

pub fn fun(x) {
  case x {
    A(..) -> x.a
    B(..) -> x.b
  }
  x.b
}


----- ERROR
error: Unknown record field
   ┌─ /src/one/two.gleam:12:5
   │
12 │   x.b
   │     ^ This field does not exist

The value being accessed has this type:

    Thingy

It does not have fields that are common across all variants.

Note: The field you are trying to access is not defined consistently across
all variants of this custom type. To fix this, ensure that all variants
include the field with the same name, position, and type.
