-
Notifications
You must be signed in to change notification settings - Fork 63
Fix the KCL any type to not panic #6748
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
base: main
Are you sure you want to change the base?
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CodSpeed Instrumentation Performance ReportMerging #6748 will not alter performanceComparing Summary
|
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'd expect all those tests to pass, if they don't then I suspect that the any type hasn't been properly wired up in execution and just exists as syntax for documentation
@@ -1020,6 +1024,7 @@ impl KclValue { | |||
_ => self, | |||
}; | |||
match ty { | |||
PrimitiveType::Any => Ok(value.clone()), |
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 think subtype
should be altered so that any
is a supertype of everything, and then this line is not needed
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.
Updating subtype
made my tests fail in a weird way 😖 so this still needs some work.
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.
Because of implicit coercion of single values into arrays, we were coercing an empty MixedArray
into HomArray { value: vec![MixedArray { ... }] }
. Fix is here: 3a07212.
I was trying to understand and test the limits of
HomArray
andMixedArray
. I tried to make functions that useany
as a type, and this needed fixing.With this PR, the following KCL works.