Skip to content

Commit

Permalink
🤖 Pick PR #59137 (visitNodesWithoutCopyingPositions...) into releas…
Browse files Browse the repository at this point in the history
…e-5.5 (#59179)

Co-authored-by: Isabel Duan <[email protected]>
  • Loading branch information
TypeScript Bot and iisaduan authored Jul 16, 2024
1 parent a0a3a79 commit 381e609
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8969,7 +8969,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (result) {
if (result.pos !== -1 || result.end !== -1) {
if (result === nodes) {
result = factory.createNodeArray(nodes, nodes.hasTrailingComma);
result = factory.createNodeArray(nodes.slice(), nodes.hasTrailingComma);
}
setTextRangePosEnd(result, -1, -1);
}
Expand Down
38 changes: 38 additions & 0 deletions tests/cases/fourslash/nodeArrayCloneCrash.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/// <reference path="fourslash.ts" />

// @module: preserve

// @Filename: /TLLineShape.ts
//// import { createShapePropsMigrationIds } from "./TLShape";
//// createShapePropsMigrationIds/**/

// @Filename: /TLShape.ts
//// import { T } from "@tldraw/validate";
////
//// /**
//// * @public
//// */
//// export function createShapePropsMigrationIds<T>(): { [k in keyof T]: any } {
//// return;
//// }

verify.completions({
marker: "",
includes: [
{
name: "createShapePropsMigrationIds",
text: "(alias) function createShapePropsMigrationIds<T>(): { [k in keyof T]: any; }\nimport createShapePropsMigrationIds",
tags: [{ name: "public", text: undefined }]
}
]
});

goTo.file("/TLShape.ts");
verify.organizeImports(
`
/**
* @public
*/
export function createShapePropsMigrationIds<T>(): { [k in keyof T]: any } {
return;
}`);

0 comments on commit 381e609

Please sign in to comment.