-
Notifications
You must be signed in to change notification settings - Fork 153
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
feat(interpreter): method calls #1652
Conversation
if (selfT.kind !== "ref") { | ||
throwNonFatalErrorConstEval( | ||
`currently, method calls only support reference type methods`, | ||
ast.loc, | ||
); | ||
} |
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.
why not support any sensible type and let the typechecker reject some programs?
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.
Typechecking is actually not executed before interpretation in some parts of the compiler, like constant initialization. This causes problems. I just opened an issue #1655.
break; | ||
case "native_function_decl": | ||
throwNonFatalErrorConstEval( | ||
"native function calls are currently not supported", |
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.
most likely will never be supported
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.
I'll change the message to "native functions are not supported".
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.
I'll change the message to "native functions are not supported".
I'd just remove the currently
: "native function calls are not supported".
Otherwise, it may seem as if we don't support them at all (outside the interpreter) :)
Requires PR #1678 to be merged into main for new tests to succeed. |
Closing this for now, feel free to fix the merge conflicts and finish it after we release Tact 1.6 |
Issue
Closes #1646.
Code is ready, but I am adding tests.
Checklist
docs/
and made the build locally