Ensure that Records keep their syntax after being added to the codebase ```ucm:hide scratch/main> builtins.merge scratch/main> load unison-src/transcripts-using-base/base.u ``` ## Record with 1 field ```unison:hide unique type Record1 = { a : Text } ``` ```ucm:hide scratch/main> add ``` ```ucm scratch/main> view Record1 ``` ## Record with 2 fields ```unison:hide unique type Record2 = { a : Text, b : Int } ``` ```ucm:hide scratch/main> add ``` ```ucm scratch/main> view Record2 ``` ## Record with 3 fields ```unison:hide unique type Record3 = { a : Text, b : Int, c : Nat } ``` ```ucm:hide scratch/main> add ``` ```ucm scratch/main> view Record3 ``` ## Record with many fields ```unison:hide unique type Record4 = { a : Text , b : Int , c : Nat , d : Bytes , e : Text , f : Nat , g : [Nat] } ``` ```ucm:hide scratch/main> add ``` ```ucm scratch/main> view Record4 ``` ## Record with many many fields ```unison:hide unique type Record5 = { zero : Nat, one : [Nat], two : [[Nat]], three: [[[Nat]]], four: [[[[Nat]]]], five: [[[[[Nat]]]]], six: [[[[[[Nat]]]]]], seven: [[[[[[[Nat]]]]]]], eight: [[[[[[[[Nat]]]]]]]], nine: [[[[[[[[[Nat]]]]]]]]], ten: [[[[[[[[[[Nat]]]]]]]]]], eleven: [[[[[[[[[[[Nat]]]]]]]]]]], twelve: [[[[[[[[[[[[Nat]]]]]]]]]]]], thirteen: [[[[[[[[[[[[[Nat]]]]]]]]]]]]], fourteen: [[[[[[[[[[[[[[Nat]]]]]]]]]]]]]], fifteen: [[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]], sixteen: [[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]], seventeen: [[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]], eighteen: [[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]], nineteen: [[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]], twenty: [[[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]]] } ``` ```ucm:hide scratch/main> add ``` ```ucm scratch/main> view Record5 ``` ## Record with user-defined type fields This record type has two fields whose types are user-defined (`Record4` and `UserType`). ```unison:hide unique type UserType = UserType Nat unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } ``` ```ucm:hide scratch/main> add ``` If you `view` or `edit` it, it _should_ be treated as a record type, but it does not (which is a bug) ```ucm scratch/main> view RecordWithUserType ``` ## Syntax Trailing commas are allowed. ```unison unique type Record5 = { a : Text, b : Int, } ```