Files
tsgo/testdata/baselines/reference/compiler/symbolToNodeBoundaryNoStackOverflow.errors.txt
2026-05-19 21:08:06 +00:00

36 lines
1.8 KiB
Plaintext

symbolToNodeBoundaryNoStackOverflow.ts(22,10): error TS2345: Argument of type '() => () => CustomNode<any>' is not assignable to parameter of type '() => CustomNode<unknown>'.
Type '() => CustomNode<typeof node.getNextNode<any>>' is not assignable to type 'CustomNode<unknown>'.
==== symbolToNodeBoundaryNoStackOverflow.ts (1 errors) ====
// Regression test for https://github.com/microsoft/TypeScript/issues/63441
// In createAnonymousTypeNodeEx for an InstantiationExpressionType, when the
// existing typeof node failed to be reused (e.g. its entity name isn't
// accessible from the current scope), the recovery boundary's fallback path
// re-entered typeToTypeNode with the same instantiation type, which would
// try to reuse the same node again, recursing without bound.
// The fix marks the type as visited around the reuse attempt so the inner
// recursion bottoms out via the existing visitedTypes guard.
export interface CustomNode<P> {
getNextNode: () => CustomNode<P>;
}
export declare const createNode: () => {
getNextNode: <T>() => CustomNode<T>;
};
function wrapNode<T>(getNode: () => CustomNode<T>) {
return getNode;
}
wrapNode(() => {
~~~~~~~
!!! error TS2345: Argument of type '() => () => CustomNode<any>' is not assignable to parameter of type '() => CustomNode<unknown>'.
!!! error TS2345: Type '() => CustomNode<typeof node.getNextNode<any>>' is not assignable to type 'CustomNode<unknown>'.
!!! related TS6212 symbolToNodeBoundaryNoStackOverflow.ts:22:10: Did you mean to call this expression?
const node = createNode();
return wrapNode<typeof node.getNextNode<any>>(node.getNextNode);
});