···88 custom types.
99 ([Surya Rose](https://github.com/GearsDatapacks))
10101111+- Fixed a bug where updating records with unlabelled fields would result in
1212+ invalid code.
1313+ ([Surya Rose](https://github.com/GearsDatapacks))
1414+1115## v1.14.0-rc1 - 2025-12-15
12161317### Compiler
···66mod tests;
77pub mod visit;
8899-pub use self::typed::{InvalidExpression, TypedExpr};
99+pub use self::typed::{InvalidExpression, RecordAccessKind, TypedExpr};
1010pub use self::untyped::{FunctionLiteralKind, UntypedExpr};
11111212pub use self::constant::{Constant, TypedConstant, UntypedConstant};
···1010use crate::type_::collapse_links;
1111use crate::type_::error::{
1212 IncorrectArityContext, InvalidImportKind, MissingAnnotation, ModuleValueUsageContext, Named,
1313- UnknownField, UnknownTypeHint, UnsafeRecordUpdateReason,
1313+ RecordField, UnknownField, UnknownTypeHint, UnsafeRecordUpdateReason,
1414};
1515use crate::type_::printer::{Names, Printer};
1616use crate::type_::{FieldAccessUsage, error::PatternMatchKind};
···808808 })
809809 .min_by_key(|&(_, distance)| distance)
810810 .map(|(option, _)| format!("Did you mean `{option}`?"))
811811+}
812812+813813+fn to_ordinal(value: u32) -> String {
814814+ match value % 10 {
815815+ 1 => format!("{value}st"),
816816+ 2 => format!("{value}nd"),
817817+ 3 => format!("{value}rd"),
818818+ _ => format!("{value}th"),
819819+ }
811820}
812821813822impl Error {
···24032412 expected_field_type,
24042413 record_field_type,
24052414 record_variant,
24062406- field_name,
24152415+ field,
24072416 ..
24082417 } => {
24092418 let mut printer = Printer::new(names);
24102419 let expected_field_type = printer.print_type(expected_field_type);
24112420 let record_field_type = printer.print_type(record_field_type);
24122421 let record_variant = printer.print_type(record_variant);
24132413- let text = wrap_format!(
24142414- "The `{field_name}` field \
24222422+ let text = match field {
24232423+ RecordField::Labelled(label) => wrap_format!(
24242424+ "The `{label}` field \
24152425of this value is a `{record_field_type}`, but the arguments given to the record \
24162426update indicate that it should be a `{expected_field_type}`.
2417242724182428Note: If the same type variable is used for multiple fields, all those fields \
24192429need to be updated at the same time if their type changes."
24202420- );
24302430+ ),
24312431+ RecordField::Unlabelled(index) => wrap_format!(
24322432+ "The {} field \
24332433+of this value is a `{record_field_type}`, but the arguments given to the record \
24342434+update indicate that it should be a `{expected_field_type}`.
24352435+24362436+Note: Unlabelled fields cannot be updated in a record update, so either add \
24372437+a label or use a record constructor.",
24382438+ to_ordinal(*index + 1),
24392439+ ),
24402440+ };
2421244124222442 Diagnostic {
24232443 title: "Incomplete record update".into(),
···11+---
22+source: compiler-core/src/type_/tests/errors.rs
33+expression: "\npub type Wibble(a) {\n Wibble(a, b: Int, c: a)\n}\n\npub fn main() {\n let w = Wibble(1, 2, 3)\n Wibble(..w, c: False)\n}\n"
44+---
55+----- SOURCE CODE
66+77+pub type Wibble(a) {
88+ Wibble(a, b: Int, c: a)
99+}
1010+1111+pub fn main() {
1212+ let w = Wibble(1, 2, 3)
1313+ Wibble(..w, c: False)
1414+}
1515+1616+1717+----- ERROR
1818+error: Incomplete record update
1919+ ┌─ /src/one/two.gleam:8:12
2020+ │
2121+8 │ Wibble(..w, c: False)
2222+ │ ^ This is a `Wibble(Int)`
2323+2424+The 1st field of this value is a `Int`, but the arguments given to the
2525+record update indicate that it should be a `Bool`.
2626+2727+Note: Unlabelled fields cannot be updated in a record update, so either add
2828+a label or use a record constructor.