Repository: tweag/nickel
Pull request #707 (2022-05-22 00:09:58)

flake.lock: Update
Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.

```
Flake lock file updates:

• Updated input 'flake-utils':
    'github:numtide/flake-utils/12806d31a381e7cd169a6bac35590e7b36dc5fe5' (2022-05-14)
  → 'github:numtide/flake-utils/04c1b180862888302ddfb2e3ad9eaa63afc60cf8' (2022-05-17)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/d89d7af1ba23bd8a5341d00bdd862e8e9a808f56' (2022-05-12)
  → 'github:NixOS/nixpkgs/48037fd90426e44e4bf03e6479e88a11453b9b66' (2022-05-18)
• Updated input 'pre-commit-hooks':
    'github:cachix/pre-commit-hooks.nix/e5e7b3b542e7f4f96967966a943d7e1c07558042' (2022-04-04)
  → 'github:cachix/pre-commit-hooks.nix/521a524771a8e93caddaa0ac1d67d03766a8b0b3' (2022-05-16)
• Updated input 'rust-overlay':
    'github:oxalica/rust-overlay/f9ddceabd2ccd2bf3d08c83832f3709c94287144' (2022-05-14)
  → 'github:oxalica/rust-overlay/3bc2619665745f5e6f2efc3d0664edad4f62201b' (2022-05-21)
```

### Running GitHub Actions on this PR

GitHub Actions will not run workflows on pull requests which are opened by a GitHub Action.

To run GitHub Actions workflows on this PR, run:

```sh
git branch -D update_flake_lock_action
git fetch origin
git checkout update_flake_lock_action
git commit --amend --no-edit
git push origin update_flake_lock_action --force
```


Patch:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0ccb4842..d4287c2b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -38,7 +38,7 @@ by email, or using any other method with the maintainers of this repository
 The following resources are oriented toward Nickel users:
 
 - The [README](./README.md) and the [design rationale](./RATIONALE.md)
-- The [blog post series][blog-series] and the [release blog post][blog-release].
+- The [blog post serie][blog-series] and the [release blog post][blog-release].
 - The [user manual][user-manual].
 
 For Nickel contributors (or aspiring contributors), the following technical
diff --git a/RATIONALE.md b/RATIONALE.md
index 56b6882d..50d180ae 100644
--- a/RATIONALE.md
+++ b/RATIONALE.md
@@ -123,7 +123,7 @@ In the following example,
 ```
 
 the configuration language has no reason to suspect that `id` and `baseURL`
-contents have been mistakenly swapped. It would need to be aware of the fact
+contents have been mistakingly swapped. It would need to be aware of the fact
 that `id` should be an integer and `baseURL` a string. Surely, an error will
 eventually pop up downstream in the pipeline, but how and when? Will the bug be
 easy to track down if the data has gone through several transformations, inside
diff --git a/README.md b/README.md
index 02b768f4..cfd33689 100644
--- a/README.md
+++ b/README.md
@@ -179,7 +179,7 @@ to be used in production. The next steps we plan to work on are:
 
 ## Related projects and inspirations
 
-- [CUE](https://cuelang.org/) is a configuration language with a focus on data
+- [Cue](https://cuelang.org/) is a configuration language with a focus on data
     validation. It introduces a new constraint system backed by a solid theory
     which ensures strong guarantees about your code. It allows for very elegant
     schema specifications. In return, the cost to pay is to abandon functions
diff --git a/doc/manual/contracts.md b/doc/manual/contracts.md
index 05bf10c7..1b293dd9 100644
--- a/doc/manual/contracts.md
+++ b/doc/manual/contracts.md
@@ -102,7 +102,7 @@ Our contract is simple: in the end, it tests the condition `value == "foo"`.
 Unfortunately, it has a few cascading ifs that don't look very nice. This is a
 necessary evil if you want to provide distinct error messages (`not a string`
 and `not a "foo"`). However, one could argue in this case that the information
-of the contract's name (which is automatically printed for contract violation
+of the contract's name (which is automatically printed for contract violiation
 error, as well as various other data) is enough to understand the error. In this
 case, we can write our contract more succinctly as:
 
diff --git a/doc/manual/correctness.md b/doc/manual/correctness.md
index 6c01cb52..7843eeb2 100644
--- a/doc/manual/correctness.md
+++ b/doc/manual/correctness.md
@@ -13,7 +13,7 @@ the following properties:
    trying to add a number to a string, or to call to a value which is not a
    function.
 2. The generated configuration is valid. Your program may be correct with
-   respect to the previous point while outputting a field `prto = "80"` instead
+   respect to the previous point while outputing a field `prto = "80"` instead
    of `port = 80`. The consumer of the configuration will probably fail.
    Typically, validity involves respecting a data schema.
 
@@ -208,7 +208,7 @@ function contract for `split` has the following limitations:
 
 #### Using a type annotation
 
-`split` is a generic function operating on builtin types. This is a good
+`split` is a generic function operating on builin types. This is a good
 candidate for static typing, which will help:
 
 - Ensure the property holds for all possible values of the parameter.
diff --git a/doc/manual/merging.md b/doc/manual/merging.md
index 91d22ddc..a6d8455d 100644
--- a/doc/manual/merging.md
+++ b/doc/manual/merging.md
@@ -6,7 +6,7 @@ slug: merging
 
 In Nickel, the basic building blocks for data are records (objects in JSON or
 attribute sets in Nix). Merging is a fundamental built-in operation whose role
-is to combine records together. Fields common to several records will be
+is to combine records togethers. Fields common to several records will be
 themselves recursively merged if possible, following the semantics described in
 this document.
 
@@ -413,7 +413,7 @@ let Port
     value >= 0 &&
     value <= 65535) in
 let GreaterThan
-  | doc "A number greater than the parameter"
+  | doc "A number greater than the paramater"
   = fun x => contract.from_predicate (fun value => value > x) in
 
 {
diff --git a/doc/manual/syntax.md b/doc/manual/syntax.md
index 3fcf5969..96a3b749 100644
--- a/doc/manual/syntax.md
+++ b/doc/manual/syntax.md
@@ -116,10 +116,10 @@ Multiline strings are useful to write indented lines. The indentation is strippe
 Example:
 ```
 > m%"
-This line has no indentation.
+This line has no identation.
   This line is indented.
     This line is even more indented.
-This line has no more indentation.
+This line has no more identation.
 "%m
 "This line has no indentation.
   This line is indented.
diff --git a/doc/manual/typing.md b/doc/manual/typing.md
index 017bb699..159a0f20 100644
--- a/doc/manual/typing.md
+++ b/doc/manual/typing.md
@@ -189,8 +189,8 @@ The following type constructors are available:
 
   Example:
   ```nickel
-  let occurrences : {_: Num} = {a = 1, b = 3, c = 0} in
-  record.map (fun char count => count + 1) occurrences : {_ : Num}
+  let occurences : {_: Num} = {a = 1, b = 3, c = 0} in
+  record.map (fun char count => count + 1) occurences : {_ : Num}
   ```
 
 <!-- - **Enum**: `<tag1, .., tagn>`: an enumeration comprised of alternatives `tag1`, -->
@@ -299,7 +299,7 @@ error: Incompatible types
 
 The reason is that **without an explicit polymorphic annotation, the typechecker
 will always infer non-polymorphic types**. If you need polymorphism, you have to
-write a type annotation. Here, `filter` is inferred to be of type `(Num -> Bool)
+write a type anntation. Here, `filter` is inferred to be of type `(Num -> Bool)
 -> Array Num -> Array Num`, guessed from the application in the right hand side of
 `result`.
 
@@ -579,8 +579,8 @@ expression or do anything non-trivial. Typically, replacing `1` with a compound
 expression `0 + 1` changes the type of `x` type to `Dyn` and makes the example
 fail. For now, the typechecker determines an apparent type that is not `Dyn`
 only for literals (numbers, strings, booleans), arrays, variables, imports and
-annotated expressions. Otherwise, the typechecker falls back to `Dyn`. It may
-do more in the future (assign `Dyn -> Dyn` to functions, `{_: Dyn}` to records,
+annotated expressions. Otherwise, the typechecker fallbacks to `Dyn`. It may do
+more in the future (assign `Dyn -> Dyn` to functions, `{_: Dyn}` to records,
 etc).
 
 ### Take-away
@@ -595,7 +595,7 @@ typechecker on, a contract annotation switches it back off.
 
 ## Using contracts as types
 
-<!-- TODO: find a good name for this section. Will need rework after merging
+<!-- TODO: find a good name for this section. Will need rework after meging
 types and contracts syntax -->
 
 Type annotations and contracts share the same syntax. This means that you can
diff --git a/flake.lock b/flake.lock
index 7520a9ea..a622b8f8 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
   "nodes": {
     "flake-utils": {
       "locked": {
-        "lastModified": 1652557277,
-        "narHash": "sha256-jSes9DaIVMdmwBB78KkFUVrlDzawmD62vrUg0GS2500=",
+        "lastModified": 1652776076,
+        "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=",
         "owner": "numtide",
         "repo": "flake-utils",
-        "rev": "12806d31a381e7cd169a6bac35590e7b36dc5fe5",
+        "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8",
         "type": "github"
       },
       "original": {
@@ -32,11 +32,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1652378906,
-        "narHash": "sha256-DeV2myAMArPvyqxp0M6z30kuXb2L9SO2QXjxbbsZQyY=",
+        "lastModified": 1652885393,
+        "narHash": "sha256-YIgvvlk4iQ1Hi7KD9o5gsojc+ApB+jiH1d5stK8uXiw=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "d89d7af1ba23bd8a5341d00bdd862e8e9a808f56",
+        "rev": "48037fd90426e44e4bf03e6479e88a11453b9b66",
         "type": "github"
       },
       "original": {
@@ -55,11 +55,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1649054408,
-        "narHash": "sha256-wz8AH7orqUE4Xog29WMTqOYBs0DMj2wFM8ulrTRVgz0=",
+        "lastModified": 1652714503,
+        "narHash": "sha256-qQKVEfDe5FqvGgkZtg5Pc491foeiDPIOeycHMqnPDps=",
         "owner": "cachix",
         "repo": "pre-commit-hooks.nix",
-        "rev": "e5e7b3b542e7f4f96967966a943d7e1c07558042",
+        "rev": "521a524771a8e93caddaa0ac1d67d03766a8b0b3",
         "type": "github"
       },
       "original": {
@@ -87,11 +87,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1652496760,
-        "narHash": "sha256-AM1almW0FjiUegqfJc6n+OO3yXTCXUsH2IEI323vbJ0=",
+        "lastModified": 1653118478,
+        "narHash": "sha256-K9fG0VT/Wi/QJpXJd6d1QrWL5ulAhy1S67n5OGBwbcE=",
         "owner": "oxalica",
         "repo": "rust-overlay",
-        "rev": "f9ddceabd2ccd2bf3d08c83832f3709c94287144",
+        "rev": "3bc2619665745f5e6f2efc3d0664edad4f62201b",
         "type": "github"
       },
       "original": {
diff --git a/lsp/README.md b/lsp/README.md
index 8f9681cb..7ff82547 100644
--- a/lsp/README.md
+++ b/lsp/README.md
@@ -47,7 +47,7 @@ the following commands.
 
 ### Using Nix (without flakes)
 
-Alternatively, you can install `nickel` and `nls` globally on older Nix versions
+Alternatively, you can insall `nickel` and `nls` globally on older Nix versions
 without flakes via `nix-env`:
 
 ```
diff --git a/notes/intersection-and-union-types.md b/notes/intersection-and-union-types.md
index e4f3ff41..a71a02d6 100644
--- a/notes/intersection-and-union-types.md
+++ b/notes/intersection-and-union-types.md
@@ -34,7 +34,7 @@ On the other hand, the advantages and disadvantages of the Keil paper seem to co
  * They have an implementation roughly based on their ideas.
 
 And some cons:
- * Intersections need to be delayed, but Unions don't. So they need to transform their types into Unions of Intersections of non-Union types.
+ * Intersections need to be delayed, but Unions don't. So they need to tranform their types into Unions of Intersections of non-Union types.
 
 
 #### Next steps after Wadler and Keil
diff --git a/src/eval/mod.rs b/src/eval/mod.rs
index 050c8da2..1cccc84c 100644
--- a/src/eval/mod.rs
+++ b/src/eval/mod.rs
@@ -276,7 +276,7 @@ where
 ///
 /// # Arguments
 ///
-/// - `clos`: the closure to evaluate
+/// - `t0`: the term to evaluate
 /// - `global_env`: the global environment containing the builtin functions of the language. Accessible from anywhere in the
 /// program.
 /// - `resolver`: the interface to fetch imports.
@@ -562,7 +562,7 @@ where
             Term::MetaValue(meta) if enriched_strict => {
                 if meta.value.is_some() {
                     /* Since we are forcing a metavalue, we are morally evaluating `force t` rather
-                     * than `t` itself. Updating a thunk after having performed this forcing may
+                     * than `t` iteself.  Updating a thunk after having performed this forcing may
                      * alter the semantics of the program in an unexpected way (see issue
                      * https://github.com/tweag/nickel/issues/123): we update potential thunks now
                      * so that their content remains a meta value.
diff --git a/src/grammar.lalrpop b/src/grammar.lalrpop
index 08c9424c..1ffefed3 100644
--- a/src/grammar.lalrpop
+++ b/src/grammar.lalrpop
@@ -337,7 +337,7 @@ RecordField: (FieldPath, RichTerm) = {
             if let Some(deft) = t {
                 deft
             } else {
-                RichTerm::new(Term::MetaValue(MetaValue::new()), pos)
+                RichTerm::new(Term::Null, pos)
             }
         };
 
diff --git a/src/term.rs b/src/term.rs
index 8d91497e..def58e64 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -525,7 +525,7 @@ impl Term {
                     _ => "",
                 };
 
-                format!("{{ {}{} }}", fields_str.join(", "), suffix)
+                format!("{{ {}{}}}", fields_str.join(", "), suffix)
             }
             Term::Array(elements) => {
                 let elements_str: Vec<String> = elements


Test patch:
diff --git a/tests/records_fail.rs b/tests/records_fail.rs
index 81b17cbb..b0e96c5d 100644
--- a/tests/records_fail.rs
+++ b/tests/records_fail.rs
@@ -49,19 +49,3 @@ fn dynamic_not_recursive() {
         Err(Error::TypecheckError(TypecheckError::UnboundIdentifier(..)))
     );
 }
-
-#[test]
-fn missing_field() {
-    assert_matches!(
-        eval("{foo | Num, bar = foo + 1}.foo"),
-        Err(Error::EvalError(EvalError::MissingFieldDef(..)))
-    );
-    assert_matches!(
-        eval("{foo : Num, bar = foo + 1}.foo"),
-        Err(Error::EvalError(EvalError::MissingFieldDef(..)))
-    );
-    assert_matches!(
-        eval("{foo, bar = foo + 1}.foo"),
-        Err(Error::EvalError(EvalError::MissingFieldDef(..)))
-    )
-}