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
Observe that the example gives the following error:
TS2322: Type 'Footer[] | undefined' is not assignable to type 'FooterTransformer | undefined'.
Property 'field' is missing in type 'Footer[]' but required in type 'FooterTransformer'.
121 const y: FooterTransformer | undefined = x;
~
Put type Footer between type Query and type ExternalLink. Updated example
Watch the error disappear.
π Expected behavior
Versions 4.9.5 an below correctly infer the types (produce no error). Changes to the order of type declarations do not affect the result.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered:
The issue here is similar to that in #56291. The example requires resolving nested FieldPathValue instantiations more than three levels deep, and which point the type checker stops evaluating to avoid what appears to be infinite recursion. As I mention in #56291, we simply don't have a good way to determine that the instantiations eventually terminate. The reason the example works when types are reordered is that type IDs end up ordering differently and don't exhibit the same increasing ID pattern that causes termination.
We're continuing to think about better ways to handle these scenarios.
π Search Terms
N/A β not sure which part of the playground code causes the issue
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?#code/C4TwDgpgBA4gTgQzACwIoBkByB7AdgZQFcAjfCAGwgGNgFjKoBeAKCigB8oBnYOAS1wBzVhygBBOIhAAeHvyGjchcuVGFcAEwgAzARA0A+EZyUrjUdVt259AbmahIsRCgxFSFarXrQWbTvBIaOgA8sQAVl7mElLSga6hEV6Kyqqcljp6hvaO0PHBAGoI5IS+zkEYOAQkZJQ0dAwBLsHutV4NEPYA9F1QEFzkAsAAtBp8XB3DNgAeI4M2UAACuVxU-GAj-fPAXVR4XOPAELgjAlrT+sPYSTTDPCCUADTL4P1rfBvDW0O7+4fHI1yo0yuD4wD4+wcr3KCTCkRoTCgAG8oABtADWEBAAC5uLwBIIALq4-IYIolaAAX3szD2uB4UAAKgAlMSYfAAMRCzIAsgBRZmI-AgAC2xGw5AAFAByFlsznc-nM6UAShpQwgcG0CCo0FannqPg5fAoGi4bRoENwIQ2Vq4yJEqLl7K5vIFhIA-LjGYh6dpsHARZrmTp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jPe8xMQaA5HAbAIowEbwAXAKBIDcBwMzumCBpEnJYJ-rgv+DC4BoJjlweA2BCBgCoTA0BuJyGr04eibhxC+ECMtHgWhZ8RGAOAYI3Av82BgggCKe+4CKGokJHI-G7CxESN4WATBl8cHLUEJIsAYiwGINXig8gYjRDBTBi-GOkMpz6KzoY9BxipFKJkSouunkjgimEb4rhPC+HeKcKXEJbB-6QMCfmXEe81FhK0eky6Ul5QqWZC1N2bVsK4QjAouAO84CxnKdOZ61IRD1PqWfAAkmExE2dibFFJl-TUIBYxGxpG+BcS59jfmmLiVpGj7BfigDibR28ilaTUJoEE+hETTHsEAA
π» Code
Apologies if the example is too long. I did my best to reduce it as much as possible, having encountered this bug in production.
π Actual behavior
Put
type Footer
betweentype Query
andtype ExternalLink
. Updated exampleWatch the error disappear.
π Expected behavior
Versions 4.9.5 an below correctly infer the types (produce no error). Changes to the order of
type
declarations do not affect the result.Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: