- Notifications
You must be signed in to change notification settings - Fork664
Open
Description
tsgo panics when processing Knex module augmentations with complex generic constraints.
Reproduction
Minimal reproduction:https://github.com/vpontis/tsgo-panic
git clone https://github.com/vpontis/tsgo-paniccd tsgo-panicbun installbun tsgo# panicsbun tsc# works fine
Stack Trace
panic: runtime error: slice bounds out of range [:52400] with length 524goroutine 1 [running]:github.com/microsoft/typescript-go/scanner.(*Scanner).GetLineAndCharacterOfPosition(...) /Users/victor/go/pkg/mod/github.com/microsoft/typescript-go@v0.0.0-20250116223143-00ad56e4d9d7/scanner/scanner.go:3156github.com/microsoft/typescript-go/scanner.GetLineAndCharacterOfPosition(...) /Users/victor/go/pkg/mod/github.com/microsoft/typescript-go@v0.0.0-20250116223143-00ad56e4d9d7/scanner/utilities.go:1222github.com/microsoft/typescript-go/transformer.(*transformer).getJSONTypeArgument(0xc002c12240, 0xc0053084c0) /Users/victor/go/pkg/mod/github.com/microsoft/typescript-go@v0.0.0-20250116223143-00ad56e4d9d7/transformer/declarations.go:2172 +0x125
File
import"knex";// Minimal reproduction of the module augmentation that causes tsgo panicdeclare module"knex"{namespaceKnex{interfaceQueryInterface<TRecordextends{}=any>{firstOrFail<TKeyextendskeyofTRecord>( ...columns:TKey[]):Knex.QueryBuilder<TRecord,Pick<TRecord,TKey>>&Promise<Pick<TRecord,TKey>>;}}}
Metadata
Metadata
Assignees
Labels
No labels