How to work with type record

let bindings aren’t mutable/updateable, but var bindings are. So either change to:

var version : Nat32 = 1;  // use var for a mutable/updatable variable
...
... version := exists.version; // use := for assignment

(and use := for assignment/update).

Or use a second let in the case:

      case(?exists) {
        let version = exists.version; // inserted let
        D.print(debug_show(exists.version));
        D.print(debug_show(version));

      };

Hope that helps!
Claudio