File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -344,9 +344,12 @@ export class ScriptLetContext {
344
344
) ;
345
345
346
346
if ( ranges . defaultRange ) {
347
- const defaultType = this . ctx . code . slice ( ...ranges . defaultRange ) ;
348
- const id = this . generateUniqueId ( defaultType ) ;
349
- const scriptLet = `type ${ id } =${ this . ctx . code . slice ( ...ranges . defaultRange ) } ;` ;
347
+ const eqDefaultType = this . ctx . code . slice (
348
+ ranges . constraintRange ?. [ 1 ] ?? ranges . idRange [ 1 ] ,
349
+ ranges . defaultRange [ 1 ] ,
350
+ ) ;
351
+ const id = this . generateUniqueId ( eqDefaultType ) ;
352
+ const scriptLet = `type ${ id } ${ eqDefaultType } ;` ;
350
353
351
354
this . appendScript (
352
355
scriptLet ,
@@ -364,8 +367,7 @@ export class ScriptLetContext {
364
367
( typeAnnotation as any ) . parent = param ;
365
368
366
369
tokens . shift ( ) ; // type
367
- tokens . shift ( ) ; // id
368
- tokens . shift ( ) ; // =
370
+ tokens . shift ( ) ; // ${id}
369
371
tokens . pop ( ) ; // ;
370
372
371
373
// Disconnect the tree structure.
You can’t perform that action at this time.
0 commit comments