···2424 number by the literal number `0.0`.
2525 ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
26262727+- The compiler no longer shows the structure of internal types when displaying
2828+ an "Inexhaustive patterns" error, making it harder to inadvertently rely on
2929+ internal implementation details.
3030+ ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
3131+2732### Build tool
28332929-- Upgraded `actions/checkout` from v4 to v6 in the GitHub Actions workflow used by `gleam new`.
3434+- Upgraded `actions/checkout` from v4 to v6 in the GitHub Actions workflow used
3535+ by `gleam new`.
3036 ([Christian Widlund](https://github.com/chrillep))
31373238- When adding a package that does not exist on Hex, the message is a bit
···99105100106- The language server now suggests completions for keywords like `echo`,
101107 `panic`, and `todo`.
108108+ ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
109109+110110+- The "Add missing patterns" code action will insert a catch all pattern for
111111+ internal types, making it harder to inadvertently rely on internal
112112+ implementation details.
102113 ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
103114104115- The language server now suggests adding missing type parameters
···529529 }
530530 }
531531532532+ /// If the type is named, return its publicity.
533533+ ///
534534+ pub fn publicity(&self) -> Option<Publicity> {
535535+ match self {
536536+ Type::Named { publicity, .. } => Some(*publicity),
537537+ Type::Fn { .. } | Type::Var { .. } | Type::Tuple { .. } => None,
538538+ }
539539+ }
540540+532541 #[must_use]
533542 /// Returns `true` is the two types are the same. This differs from the
534543 /// standard `Eq` implementation as it also follows all links to check if
···11+---
22+source: compiler-core/src/type_/tests/errors.rs
33+expression: "import wibble.{type Wibble}\n\npub fn go(wibble: Wibble) {\n case wibble {}\n}"
44+---
55+----- SOURCE CODE
66+-- wibble.gleam
77+@internal
88+ pub type Wibble { Wibble Wobble Woo }
99+1010+-- main.gleam
1111+import wibble.{type Wibble}
1212+1313+pub fn go(wibble: Wibble) {
1414+ case wibble {}
1515+}
1616+1717+----- ERROR
1818+error: Inexhaustive patterns
1919+ ┌─ /src/one/two.gleam:4:3
2020+ │
2121+4 │ case wibble {}
2222+ │ ^^^^^^^^^^^^^^
2323+2424+This case expression does not have a pattern for all possible values. If it
2525+is run on one of the values without a pattern then it will crash.
2626+2727+The missing patterns are:
2828+2929+ _
···11+---
22+source: compiler-core/src/type_/tests/errors.rs
33+expression: "import wibble.{type Wibble}\n\npub type Type {\n Type(wibble: Wibble, list: List(Int))\n}\n\npub fn go(value: Type) {\n case value {}\n}"
44+---
55+----- SOURCE CODE
66+-- wibble.gleam
77+@internal
88+ pub type Wibble { Wibble Wobble Woo }
99+1010+-- main.gleam
1111+import wibble.{type Wibble}
1212+1313+pub type Type {
1414+ Type(wibble: Wibble, list: List(Int))
1515+}
1616+1717+pub fn go(value: Type) {
1818+ case value {}
1919+}
2020+2121+----- ERROR
2222+error: Inexhaustive patterns
2323+ ┌─ /src/one/two.gleam:8:3
2424+ │
2525+8 │ case value {}
2626+ │ ^^^^^^^^^^^^^
2727+2828+This case expression does not have a pattern for all possible values. If it
2929+is run on one of the values without a pattern then it will crash.
3030+3131+The missing patterns are:
3232+3333+ Type(wibble:, list:)