diff --git a/- b/- new file mode 120000 index 00000000..5da285f2 --- /dev/null +++ b/- @@ -0,0 +1 @@ +/nix/store/jnzl9smbj3afqmi0zvzq88g5vfq0hpcg-poppler-utils-21.06.1 \ No newline at end of file diff --git a/examples/a.ncl b/examples/a.ncl new file mode 100644 index 00000000..27dd9640 --- /dev/null +++ b/examples/a.ncl @@ -0,0 +1,40 @@ +let func: Num -> Num -> Num -> Num = fun x y z => + x + + y + + z +in + +let EqualsTo = fun referenceValue label value => + if referenceValue == value then + value + else + contracts.blame label in + +let IsTrue = EqualsTo true in + +let Checked = { + b.string | #IsTrue +} in + +let config: { + b: { + string : Bool, + }, + sum : Num, + jump: Bool, +} = { + b."string" = true, + jump = b.string, + sum = func 1 1 1 +} in +let rec : { a: Str, b: Str }= { + + a ="String", + b = a, + +} + +in + + +(config | #Checked).b.string diff --git a/examples/b.ncl b/examples/b.ncl new file mode 100644 index 00000000..ad0ab8c4 --- /dev/null +++ b/examples/b.ncl @@ -0,0 +1,6 @@ +let abc = { + foo.baz.bar = 1, + bar = foo.baz +} in + +abc.foo.baz diff --git a/examples/lists/tst.ncl b/examples/lists/tst.ncl new file mode 100644 index 00000000..e69de29b diff --git a/src/typecheck/mod.rs b/src/typecheck/mod.rs index 862ead02..bb9ced71 100644 --- a/src/typecheck/mod.rs +++ b/src/typecheck/mod.rs @@ -671,6 +671,7 @@ fn type_check_( for (id, _) in stat_map { envs.insert(id.clone(), ty_dyn.clone()); + linearizer.retype_ident(lin, id, ty_dyn.clone()) } stat_map @@ -690,7 +691,8 @@ fn type_check_( if let Term::RecRecord(..) = t.as_ref() { for (id, rt) in stat_map { let tyw = binding_type(rt.as_ref(), &envs, state.table, strict); - envs.insert(id.clone(), tyw); + envs.insert(id.clone(), tyw.clone()); + linearizer.retype_ident(lin, id, tyw); } }