-
-
Notifications
You must be signed in to change notification settings - Fork 357
[Future Ruquest] An easy way to create a partial of a class #2561
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
Comments
It seems currently the diagnostic for missing fields does not take into account inheritance so I end up doing what you do here but instead of redefining every field I use This also means that abusing this bug and enabling something like a generic inheritance I think following recent updates in LuaLS we could end up with a suffix for the |
Having something to mark a type's (or class's) fields as optional is sorely needed. Otherwise, you have to go and recreate/redefine it several times, which is just not feasible especially if you have more than a few fields. My use-case is similar to yours.
I came across that recently too. Definitely a bug imo. |
Uh oh!
There was an error while loading. Please reload this page.
I want a generics equivalent to
Partial<T>
in TypeScript.When creating some extension in lua, the user should write only the parts that they want to change from the default settings in order to configure it. Internally, however, the user settings are merged with the default settings to create a configuration table with no missing field. In this case, I am not happy to have to define these two classes separately, because it can cause bugs due to synchronization errors.
The text was updated successfully, but these errors were encountered: