Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Type checking for the Symbol meta-type doesn't work properly #673

Open
mvpeterson opened this issue Apr 19, 2024 · 1 comment
Open

Type checking for the Symbol meta-type doesn't work properly #673

mvpeterson opened this issue Apr 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mvpeterson
Copy link
Contributor

Describe the bug
Want to set type Symbol for a function input argument. When I pass an argument like (This is in expression) type checking is passed, though it should not.

To Reproduce
Run the following MeTTa script

(: foo (-> Symbol Type))
(= (foo $x) $x)
!(foo (This is an expression))

Expected behavior
[(Error (This is an expression) BadType)]

Actual behavior
[(This is an expression)]

Additional context

  • MeTTa version: 0.1.dev2471+ge7ba2bf.d20240419, compiled with "minimal"
  • !(get-type (This is an expression)) gives [%Undefined%]
@vsbogd
Copy link
Collaborator

vsbogd commented Apr 20, 2024

Another example of the issue:

(: foo_var (-> Variable Type))
(= (foo_var $x) (get-type $x))
!(foo_var 100) ; works, fails with type error
!(foo_var $x) ; works, returns %Undefined%
!(foo_var S) ; doesn't work, returns %Undefined%
!(foo_var (an expression)) ; doesn't work, returns %Undefined%

@vsbogd vsbogd added the bug Something isn't working label Aug 16, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants