-
Notifications
You must be signed in to change notification settings - Fork 642
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
TypeScript does not recognize overriding mandatory property with optional one in sub-model #2216
Comments
Thanks for the issue report @andreykurilin, and I'm sorry for the inconvenience! I see @thegedge has assigned this to himself, so I expect good things here. I put together a CodeSandbox with the repro code in case that helps demonstrate the issue for others: https://codesandbox.io/p/sandbox/g3w8ft?file=%2Fsrc%2Findex.ts%3A8%2C15 |
Sorry for the delay, but it's been really busy for me lately. Thought I'd explore what's happening here: Makes sense that if you have [EDIT] |
Unfortunately, we'll need to revert this fix. The only way to model this correctly in TypeScript is running up against excessively deep type instantiation. At the moment, there's no viable solution to fix both bugs at the same time. Maybe if TypeScript makes progress on microsoft/TypeScript#34933, we can revisit it. Another option for the long term will be fixing our type system overall. I don't have a clear roadmap or plan for that, but I will reopen this issue for now so this context doesn't get lost. |
I'm getting a typescript compilation error which looks related to this fix. This is the code to reproduce the error. I couldn't actually get the error in the sample unfortunately. In the real-world it was compiled as part of typescript project. The compilation error in this case is in the form of
and
Thanks! |
Hey @mmakhalaf - yeah, if the reproduction is happening intermittently, it may be due to the excessively deep instantiation. It's possible that a larger codebase is having problems with that type. I'll deploy a fix to version |
No errors using v7.0.1, thanks! |
Minimal reproduction code
Describe the expected behavior
Initialization of
PasswordInputStore
should not require specifying optionalerror
property.Describe the observed behavior
TypeScript fails as
error
property is not provided.The text was updated successfully, but these errors were encountered: