Replies: 1 comment
-
|
I think there is maybe some tweaking we should do to the templated types so that they all have a templatedeclarationode and this intersection is not needed. However for this specific case, I am assuming you are only looking to get template instance in that case I would use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We have the following code:
Inside the
ifstatement,operationgets narrowed tonever. This happens becauseisTemplateDeclarationis defined as:and
Operationis defined as:and
OperationStatementNodeas:So,
Operationalways has anodewith typeTemplateDeclarationNodemaking theOperationalways a template declaration. So, typescript correctly deduces thatisTemplateDeclaration(operation)can never be false.I wonder what's up here. Is that
ifstatement safe to remove or is something wrong else where?Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions