File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -633,6 +633,14 @@ export class Program extends DiagnosticEmitter {
633
633
}
634
634
private _stringInstance : Class | null = null ;
635
635
636
+ /** Gets the standard `RefString` instance. */
637
+ get refStringInstance ( ) : Class {
638
+ let cached = this . _refStringInstance ;
639
+ if ( ! cached ) this . _refStringInstance = cached = this . requireClass ( CommonNames . RefString ) ;
640
+ return cached ;
641
+ }
642
+ private _refStringInstance : Class | null = null ;
643
+
636
644
/** Gets the standard `RegExp` instance. */
637
645
get regexpInstance ( ) : Class {
638
646
let cached = this . _regexpInstance ;
Original file line number Diff line number Diff line change @@ -2343,6 +2343,8 @@ export class Resolver extends DiagnosticEmitter {
2343
2343
}
2344
2344
case LiteralKind . String :
2345
2345
case LiteralKind . Template : {
2346
+ // Resolve to stringref if context indicates
2347
+ if ( ctxType . kind == TypeKind . String ) return this . program . refStringInstance ;
2346
2348
return this . program . stringInstance ;
2347
2349
}
2348
2350
case LiteralKind . RegExp : {
You can’t perform that action at this time.
0 commit comments