-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding documentation for subtyping (#1990)
* Add subsumption rule between Record/Dictionary * Remove commented code * Remove clone in pattern match, replaced fold by a for loop, take into account TailUnifVar and TailConstant * Update & add comments * Add integration tests * add test with chaining std function on records * add manual documentation for record/dictionary subtyping * Modify manual * Changing contract to typing * Update core/tests/integration/inputs/typecheck/chaining_dictionary_function_record_dictionary_subtyping.ncl Co-authored-by: Yann Hamdaoui <[email protected]> * Update doc/manual/typing.md Co-authored-by: Yann Hamdaoui <[email protected]> * Fix test * Add motivation * Fix code example * Add Array/Array and Dictionary/Dictionary subtyping documentation * Fix code (does not fix TypecheckError) * Fix code examples (does fix errors) * Fix subsumption * Fix subsumption * Improve the manual section on subtyping * Add generic example to work around function subsumption * Update doc/manual/typing.md * Update doc/manual/typing.md * Fix format problem * Update doc/manual/typing.md --------- Co-authored-by: Yann Hamdaoui <[email protected]> Co-authored-by: Yann Hamdaoui <[email protected]>
- Loading branch information
1 parent
a7dc359
commit 699cf5d
Showing
4 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...integration/inputs/typecheck/chaining_dictionary_function_record_dictionary_subtyping.ncl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# test.type = 'error' | ||
# [test.metadata] | ||
# error = 'EvalError::BlameError' | ||
let x = {foo = 1, bar = 2} in | ||
let y = std.record.insert "baz" 5 x in | ||
let _ = std.record.get "foo" y in | ||
let z = std.record.remove "foo" y in | ||
std.record.get "foo" z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters