-
Notifications
You must be signed in to change notification settings - Fork 215
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
Spread of Record<T>
into a model
#2442
Comments
I think it should not be allowed. The only time it makes sense is if it's the first item in the model and there is only one, but at that point why not use |
The issue is we then have this difference in behavior between |
More support for a |
Also, I'm not entirely sure it makes sense for |
Yeah, I also found typescript can't express with different types between the known properties and additional properties. |
Typescript does if you use |
My concern is if typescript can not express this, I don't know how other languages could possibly do that. so it may turn out to be a feature none of the SDK emitters can support :( |
Replying to past Brian, who was wrong:
Spread works on properties period, the fact that a set of properties is unbounded doesn't mean they are not properties. Indexer is an implementation detail of how to represent this unbounded set of properties. |
|
@timotheeguerin is |
This was talked with the brainstorming design meeting yersteday and it feels like we should allow it. Design above explain what is means. This is just a proposal though, we might not allow it in the final design. |
Design good.
|
implementation in #2785 |
Taking this from this issue which was about intersecting a model with a Record #1649
Should this be allowed?
Playground showing current behaviors
There is also some question on what does it change if we implement this proposal where
...
would allow to override previous properties #1292 Does doingi: int32, ...Record<string>
basically erase thei
property.The text was updated successfully, but these errors were encountered: