Skip to content

Commit e927b04

Browse files
committed
sync with resolver
1 parent 13214ba commit e927b04

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/program.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,14 @@ export class Program extends DiagnosticEmitter {
633633
}
634634
private _stringInstance: Class | null = null;
635635

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+
636644
/** Gets the standard `RegExp` instance. */
637645
get regexpInstance(): Class {
638646
let cached = this._regexpInstance;

src/resolver.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,6 +2343,8 @@ export class Resolver extends DiagnosticEmitter {
23432343
}
23442344
case LiteralKind.String:
23452345
case LiteralKind.Template: {
2346+
// Resolve to stringref if context indicates
2347+
if (ctxType.kind == TypeKind.String) return this.program.refStringInstance;
23462348
return this.program.stringInstance;
23472349
}
23482350
case LiteralKind.RegExp: {

0 commit comments

Comments
 (0)