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
Sidenote about the snippet used: I noticed this bug while using the mongodb package and was not able to reproduce it with standalone types. This package uses very complicated types so I couldn't determine where the error was coming from, what I can tell is that it only starts happening when we use two or more interfaces in a union in the collection() call that have the same property with different string literals (in this case property "a" exists in interfaces A and B and has the value "a" in A and "b" in B). Although this template says not to use external libraries, I believe this is still a bug with TS as it is incorrectly inferring the type of the object passed to $unset. If anyone can reproduce this bug without using the package and explain why it happens I'd appreciate it a lot! This was also discussed on the TS Discord server: https://canary.discord.com/channels/508357248330760243/1114908480235651102
The type of the values of the object is inferred as a generic boolean, which is not compatible with true
π Expected behavior
Like in v5.0.4, an object of strings mapped to the constant value true should be assignable to the type required by the function which is true | "" | 1.
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
Playground link with relevant code
Sidenote about the snippet used: I noticed this bug while using the mongodb package and was not able to reproduce it with standalone types. This package uses very complicated types so I couldn't determine where the error was coming from, what I can tell is that it only starts happening when we use two or more interfaces in a union in the collection() call that have the same property with different string literals (in this case property "a" exists in interfaces A and B and has the value "a" in A and "b" in B). Although this template says not to use external libraries, I believe this is still a bug with TS as it is incorrectly inferring the type of the object passed to $unset. If anyone can reproduce this bug without using the package and explain why it happens I'd appreciate it a lot! This was also discussed on the TS Discord server: https://canary.discord.com/channels/508357248330760243/1114908480235651102
π» Code
π Actual behavior
The type of the values of the object is inferred as a generic
boolean
, which is not compatible withtrue
π Expected behavior
Like in v5.0.4, an object of strings mapped to the constant value
true
should be assignable to the type required by the function which istrue | "" | 1
.The text was updated successfully, but these errors were encountered: