-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove type based duplicates #745
Merged
vsbogd
merged 18 commits into
trueagi-io:main
from
vsbogd:remove-type-based-duplicates-2
Jul 23, 2024
Merged
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
25dc4bc
Fix collapse_bind for empty results
vsbogd 3c4f9bd
Add %Undefined% to the list of types for tuples
vsbogd fe846b5
Simplify MettaResult type
vsbogd e0ec52e
Optimize match_types() function
vsbogd 4dd9434
Improve once() and empty() utility functions' signature
vsbogd d4bc600
Check if function type is applicable to the signature before call
vsbogd 5d449ad
Change match_type signature
vsbogd b2fdc72
Filter expression types properly
vsbogd 84b8cea
Rename interpret_ functions to metta_
vsbogd e39d528
Add a comment on an small issue to fix it some day in future
vsbogd c7cb691
Code refactoring: rename variables, remove cloning
vsbogd 0f20866
Add unit test
vsbogd 6c29838
Comment results of the type check in tests
vsbogd 8ef07e9
Make test passing for the old_interpreter feature
vsbogd edf7018
Merge branch 'main' into remove-type-based-duplicates-2
vsbogd ba3ed11
Add TODO to revisit tests later
vsbogd aa6dea1
Mention old_interpreter to find this place easy
vsbogd 64b0848
Merge branch 'main' into remove-type-based-duplicates-2
vsbogd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -59,7 +59,11 @@ Auto type-checking can be enabled | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
; let binds without type checking, but errors when used | ||
(let $x (+ 5 "S") $x) | ||
|
||
(: f (-> $t Number)) | ||
!(assertEqualToResult | ||
(f (+ 5 "S")) | ||
((Error "S" BadType))) | ||
; TODO: This test has different behavior in old_interpreter and minimal interpreter. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I like the new behavior better |
||
; In first case it returns (Error "S" BadType). In second case it returns | ||
; (Error (+ 5 "S") BadType). Uncomment when old_interpreter feature is removed | ||
;!(assertEqualToResult | ||
; (f (+ 5 "S")) | ||
; ((Error (+ 5 "S") BadType))) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree. The type of
(UntypedC "5")
should be reducible to%Undefined%
meaning that the whole expression can type-check. I'd add "FIXME" or "TODO", because we may need to revisit these tests and uncomment their updated versions