You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now I am working on a spec where there are two data structures that are identical. The only difference is that they both use a different enum (with overlapping values, so I cannot merge them). I want to use params for this, so something like:
The only difference is that they both use a different enum (with overlapping values, so I cannot merge them). I want to use params for this
You can't. It would be nice to be able to define a "template" type and reuse it while one of the inside field has a variable type (or variable enum, makes a little difference), but in statically-typed languages this can be done relatively easily only at compile time (unlike params, which support expressions, are evaluated at run time and there's no problem with that). So we'll need to introduce a new concept of type templates/generics (#135) into the KS language.
Right now I am working on a spec where there are two data structures that are identical. The only difference is that they both use a different enum (with overlapping values, so I cannot merge them). I want to use params for this, so something like:
but this doesn't seem to work. What am I doing wrong?
The text was updated successfully, but these errors were encountered: