-
Notifications
You must be signed in to change notification settings - Fork 118
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
fix: runtime type check can ignore type package name #1537
Conversation
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.
LGTM
Signed-off-by: peefy <[email protected]>
173453a
to
b11aafd
Compare
Pull Request Test Coverage Report for Build 10242340617Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
A very unexpected fix... I tried to figure out this problem on my own and got to the following:
I was unable to find the place where AST I expected that in the execution tree, the full type name would be input for the |
Hello @bozaro Sorry, I didn't understand what you meant. Are you saying that I made the wrong fix? Can you provide some specific examples? |
If I understand correctly, the problem in this case is that kcl/kclvm/runtime/src/value/val_type.rs Line 390 in 5417342
However, if I'm not mistaken, this method is only used for runtime checking and never receives a type name from a string literal in the code. I would simply always pass the full type name to |
I see. The correct approach would be to handle type aliases or type cast during compilation instead of adding a |
Oh wow... Type alias is resolved by a separate mechanism... Due to the processing of type alias, I seem to have false expectations about generating an execution tree (I expected |
Yes, SchemaType from AST is grammar type and is not a semantic type. Due to the existence of user-defined types and type aliases, we need to go through the semantic analysis stage to obtain the true schema type. |
1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
fix #1536
fix: runtime type check can ignore type package name