Skip to content

Commit 50f1b7b

Browse files
committed
Add back in code that hangs typescript and add file for reproducing the hang.
1 parent 457e709 commit 50f1b7b

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

src/everything.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -788,13 +788,15 @@ export class SqlBuilder<
788788
with<A extends string, WCols extends Record<string, Column>, WParams>(
789789
alias: A,
790790
withSelect: SelectStatement<WCols, WParams>
791-
): SqlBuilder<
792-
Cols,
793-
P & WParams,
794-
RT,
795-
OT,
796-
WT & Record<A, Table<WCols, A, never, true>>,
797-
GBC
791+
): BeforeSelect<
792+
SqlBuilder<
793+
Cols,
794+
P & WParams,
795+
RT,
796+
OT,
797+
WT & Record<A, Table<WCols, A, never, true>>,
798+
GBC
799+
>
798800
> {
799801
const withClause = new WithClause(alias, withSelect)
800802

typings-tests/autocompleteBug.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { SqlBuilder } from "../src/everything"
2+
declare const db: SqlBuilder<{}, {}, never, never, {}, never>
3+
4+
// to reproduce bug, type out the line below(uncommented of course) and try to have it autocomplete after the period at the end.
5+
// note that actually typing the line from scratch seems to be important to reproducing the bug.
6+
// I can't reproduce it by simply uncommenting that line and trying to autocomplete, and I can't reproduce by copy pasting it.
7+
8+
// db.with("a", db.

0 commit comments

Comments
 (0)