-
Notifications
You must be signed in to change notification settings - Fork 54
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
type-check auto doesn't check in add-atom #821
Comments
Thanks for raising this question. The ability to add incorrect atoms into atomspace is implemented intentionally because when new information is added into atomspace in the future the types of atoms can be changed and type check can be passed. It is not clear to me should we prevent this when On the other hand if one generates code automatically and want it to be type-checked before adding generated code into atomspace then there is a lack of instruments to do this. We could solve it by adding a function to do a type-check in a runtime manually. Using such function one will be able to check generated code for a type correctness before adding it into the atomspace if it is needed. @AdrickTench could you please elaborate whether you have some specific goal in mind when writing the code above or what bothers you is a discrepancy between implicit and explicit adding atoms into atomspace? |
@Necr0x0Der , suggested using |
Discussed it with @Necr0x0Der offline. He suggested adding more strict variant of the |
Yes, the discrepancy between implicit and explicit bothers me. I was also trying to write tests for behavior with @TeamSPoon suggested I might instead write tests for type errors are generated by
|
re-pinging @vsbogd since he'd know for sure the syntax for loading files in H-E that would use the type checker. some thoughts though: The and loaded into a new space like: Personally I think much hard coded type checking wont be savvy enough to catch non obvious type errors sometimes. If anything, it should only issue a warning and not errors (for instance then it could be safe to let add-atom warn about these things). Also any type check tool will probably want be called by a developer when they think everyhting is loaded and ready for type check (or LSP server) to able do type check their convenance like (type-check &my-space) and get the list of warnings |
Am I right that you faced the issue when you was trying to write a test for |
Yes, it is true.
Yeah, it is the reason why
It is nice idea. At least we could add another
Yes it is possible using |
|
OK, I can write tests of |
Setting type-check to auto doesn't catch type errors in
add-atom
. This seems undesirable. As far as I knowadd-atom &self A
is the same as justA
, so why shouldadd-atom
get to bypass type-checking if it has been enabled.The text was updated successfully, but these errors were encountered: