Skip to content

Commit 9f0b3c6

Browse files
committed
Merge branch 'main' into jabaile/move-rest
2 parents 297d123 + 7a99cd9 commit 9f0b3c6

File tree

24,002 files changed

+974666
-27708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

24,002 files changed

+974666
-27708
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
25+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
2626
- uses: ./.github/actions/setup-go
2727
with:
2828
cache-name: build
@@ -63,7 +63,7 @@ jobs:
6363
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6464
with:
6565
submodules: ${{ !matrix.no-submodules }}
66-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
66+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
6767
with:
6868
node-version: 'lts/*'
6969
- uses: ./.github/actions/setup-go
@@ -118,7 +118,7 @@ jobs:
118118

119119
steps:
120120
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
121-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
121+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
122122
- uses: ./.github/actions/setup-go
123123
with:
124124
cache-name: lint${{ (matrix.noembed && '-noembed') || ''}}
@@ -134,7 +134,7 @@ jobs:
134134
runs-on: ubuntu-latest
135135
steps:
136136
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
137-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
137+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
138138
- uses: ./.github/actions/setup-go
139139
with:
140140
cache-name: format
@@ -150,7 +150,7 @@ jobs:
150150
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
151151
with:
152152
submodules: true
153-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
153+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
154154
- uses: ./.github/actions/setup-go
155155
with:
156156
cache-name: generate
@@ -179,7 +179,7 @@ jobs:
179179
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
180180
with:
181181
submodules: true
182-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
182+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
183183
- uses: ./.github/actions/setup-go
184184
with:
185185
cache-name: smoke

.github/workflows/merge-queue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2020
with:
2121
submodules: true
22-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
22+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
2323
with:
2424
node-version: 'lts/*'
2525
- uses: ./.github/actions/setup-go

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,5 @@ custom-gcl.hash
192192
.DS_Store
193193

194194
.idea
195+
196+
!testdata/submoduleAccepted.txt

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ linters:
3030
- intrange
3131
- makezero
3232
- mirror
33+
- misspell
3334
- musttag
3435
- nolintlint
3536
- paralleltest

Herebyfile.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const { values: options } = parseArgs({
2525
args: process.argv.slice(2),
2626
options: {
2727
race: { type: "boolean" },
28+
tests: { type: "string", short: "t" },
2829
fix: { type: "boolean" },
2930
noembed: { type: "boolean" },
3031
debug: { type: "boolean" },
@@ -203,6 +204,7 @@ export const generate = task({
203204
const goTestFlags = [
204205
...goBuildFlags,
205206
...goBuildTags(),
207+
...(options.tests ? [`-run=${options.tests}`] : []),
206208
];
207209

208210
const goTestEnv = {

cmd/tsgo/main.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func main() {
220220
var emitTime time.Duration
221221
if compilerOptions.NoEmit.IsFalseOrUnknown() {
222222
emitStart := time.Now()
223-
result := prog.Emit(&program.EmitOptions{})
223+
result := prog.Emit(program.EmitOptions{})
224224
diagnostics = append(diagnostics, result.Diagnostics...)
225225
emitTime = time.Since(emitStart)
226226
}
@@ -237,15 +237,8 @@ func main() {
237237
printDiagnostics(program.SortAndDeduplicateDiagnostics(diagnostics), host, compilerOptions)
238238
}
239239

240-
var unsupportedExtensions []string
241-
for _, file := range prog.SourceFiles() {
242-
extension := tspath.TryGetExtensionFromPath(file.FileName())
243-
if extension == tspath.ExtensionTsx || slices.Contains(tspath.SupportedJSExtensionsFlat, extension) {
244-
unsupportedExtensions = core.AppendIfUnique(unsupportedExtensions, extension)
245-
}
246-
}
247-
if len(unsupportedExtensions) != 0 {
248-
fmt.Fprintf(os.Stderr, "Warning: The project contains unsupported file types (%s), which are currently not fully type-checked.\n", strings.Join(unsupportedExtensions, ", "))
240+
if exts := prog.UnsupportedExtensions(); len(exts) != 0 {
241+
fmt.Fprintf(os.Stderr, "Warning: The project contains unsupported file types (%s), which are currently not fully type-checked.\n", strings.Join(exts, ", "))
249242
}
250243

251244
if compilerOptions.ListFiles.IsTrue() {

internal/ast/ast.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ func (n *Node) ModifierFlags() ModifierFlags {
442442
if modifiers != nil {
443443
return modifiers.ModifierFlags
444444
}
445+
if n.Flags&NodeFlagsNestedNamespace != 0 {
446+
return ModifierFlagsExport
447+
}
445448
return ModifierFlagsNone
446449
}
447450

internal/ast/utilities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ func GetExternalModuleName(node *Node) *Expression {
16751675
case KindImportType:
16761676
return getImportTypeNodeLiteral(node)
16771677
case KindCallExpression:
1678-
return node.AsCallExpression().Arguments.Nodes[0]
1678+
return core.FirstOrNil(node.AsCallExpression().Arguments.Nodes)
16791679
case KindModuleDeclaration:
16801680
if IsStringLiteral(node.AsModuleDeclaration().Name()) {
16811681
return node.AsModuleDeclaration().Name()

internal/ast/visitor.go

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -258,18 +258,21 @@ func (v *NodeVisitor) visitTopLevelStatements(nodes *StatementList) *StatementLi
258258
}
259259

260260
func (v *NodeVisitor) liftToBlock(node *Statement) *Statement {
261-
if node != nil && node.Kind == KindSyntaxList {
262-
nodes := node.AsSyntaxList().Children
263-
if len(nodes) == 0 {
264-
node = nil
265-
} else if len(nodes) == 1 {
266-
node = nodes[0]
261+
var nodes []*Node
262+
if node != nil {
263+
if node.Kind == KindSyntaxList {
264+
nodes = node.AsSyntaxList().Children
267265
} else {
268-
node = v.Factory.NewBlock(v.Factory.NewNodeList(nodes), true /*multiLine*/)
269-
}
270-
if node != nil && node.Kind == KindSyntaxList {
271-
panic("The result of visiting and lifting a Node may not be SyntaxList")
266+
nodes = []*Node{node}
272267
}
273268
}
269+
if len(nodes) == 1 {
270+
node = nodes[0]
271+
} else {
272+
node = v.Factory.NewBlock(v.Factory.NewNodeList(nodes), true /*multiLine*/)
273+
}
274+
if node.Kind == KindSyntaxList {
275+
panic("The result of visiting and lifting a Node may not be SyntaxList")
276+
}
274277
return node
275278
}

internal/binder/binder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func bindSourceFile(file *ast.SourceFile, options *core.CompilerOptions) {
117117
b.file = file
118118
b.options = options
119119
b.languageVersion = options.GetEmitScriptTarget()
120-
b.inStrictMode = options.AlwaysStrict.IsTrue()
120+
b.inStrictMode = (options.AlwaysStrict.IsTrue() || options.Strict.IsTrue()) && !file.IsDeclarationFile || ast.IsExternalModule(file)
121121
b.unreachableFlow = b.newFlowNode(ast.FlowFlagsUnreachable)
122122
b.reportedUnreachableFlow = b.newFlowNode(ast.FlowFlagsUnreachable)
123123
b.bind(file.AsNode())

internal/binder/referenceresolver.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ var _ ReferenceResolver = &referenceResolver{}
2727

2828
type referenceResolver struct {
2929
resolver *NameResolver
30+
options *core.CompilerOptions
3031
hooks ReferenceResolverHooks
3132
}
3233

33-
func NewReferenceResolver(hooks ReferenceResolverHooks) ReferenceResolver {
34+
func NewReferenceResolver(options *core.CompilerOptions, hooks ReferenceResolverHooks) ReferenceResolver {
3435
return &referenceResolver{
35-
hooks: hooks,
36+
options: options,
37+
hooks: hooks,
3638
}
3739
}
3840

@@ -91,7 +93,9 @@ func (r *referenceResolver) getReferencedValueSymbol(reference *ast.IdentifierNo
9193
}
9294

9395
if r.resolver == nil {
94-
r.resolver = &NameResolver{}
96+
r.resolver = &NameResolver{
97+
CompilerOptions: r.options,
98+
}
9599
}
96100

97101
return r.resolver.Resolve(location, reference.Text(), ast.SymbolFlagsExportValue|ast.SymbolFlagsValue|ast.SymbolFlagsAlias, nil /*nameNotFoundMessage*/, false /*isUse*/, false /*excludeGlobals*/)

internal/checker/checker.go

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,8 @@ type Checker struct {
721721
lastGetCombinedNodeFlagsResult ast.NodeFlags
722722
lastGetCombinedModifierFlagsNode *ast.Node
723723
lastGetCombinedModifierFlagsResult ast.ModifierFlags
724-
inferenceStates []InferenceState
725-
flowStates []FlowState
724+
freeinferenceState *InferenceState
725+
freeFlowState *FlowState
726726
flowLoopCache map[FlowLoopKey]*Type
727727
flowLoopStack []FlowLoopInfo
728728
sharedFlows []SharedFlow
@@ -741,7 +741,7 @@ type Checker struct {
741741
reverseMappedSourceStack []*Type
742742
reverseMappedTargetStack []*Type
743743
reverseExpandingFlags ExpandingFlags
744-
relaters []Relater
744+
freeRelater *Relater
745745
subtypeRelation *Relation
746746
strictSubtypeRelation *Relation
747747
assignableRelation *Relation
@@ -791,6 +791,7 @@ type Checker struct {
791791
getGlobalClassMethodDecoratorContextType func() *Type
792792
getGlobalClassGetterDecoratorContextType func() *Type
793793
getGlobalClassSetterDecoratorContextType func() *Type
794+
getGlobalClassAccessorDecoratorContxtType func() *Type
794795
getGlobalClassAccessorDecoratorContextType func() *Type
795796
getGlobalClassAccessorDecoratorTargetType func() *Type
796797
getGlobalClassAccessorDecoratorResultType func() *Type
@@ -2171,6 +2172,8 @@ func (c *Checker) checkSourceElementWorker(node *ast.Node) {
21712172
c.checkTypeAliasDeclaration(node)
21722173
case ast.KindEnumDeclaration:
21732174
c.checkEnumDeclaration(node)
2175+
case ast.KindEnumMember:
2176+
c.checkEnumMember(node)
21742177
case ast.KindModuleDeclaration:
21752178
c.checkModuleDeclaration(node)
21762179
case ast.KindImportDeclaration:
@@ -4270,7 +4273,7 @@ basePropertyCheck:
42704273
for errorNode, memberInfo := range notImplementedInfo {
42714274
switch {
42724275
case len(memberInfo.missedProperties) == 1:
4273-
missedProperty := "'" + memberInfo.missedProperties[0] + "'"
4276+
missedProperty := memberInfo.missedProperties[0]
42744277
if ast.IsClassExpression(errorNode) {
42754278
c.error(errorNode, diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, missedProperty, memberInfo.baseTypeName)
42764279
} else {
@@ -4711,6 +4714,15 @@ func (c *Checker) checkEnumDeclaration(node *ast.Node) {
47114714
}
47124715
}
47134716

4717+
func (c *Checker) checkEnumMember(node *ast.Node) {
4718+
if ast.IsPrivateIdentifier(node.Name()) {
4719+
c.error(node, diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier)
4720+
}
4721+
if node.Initializer() != nil {
4722+
c.checkExpression(node.Initializer())
4723+
}
4724+
}
4725+
47144726
func (c *Checker) checkModuleDeclaration(node *ast.Node) {
47154727
if body := node.Body(); body != nil {
47164728
c.checkSourceElement(body)
@@ -8025,7 +8037,7 @@ func (c *Checker) isConstructorAccessible(node *ast.Node, signature *Signature)
80258037
declaration := signature.declaration
80268038
modifiers := getSelectedEffectiveModifierFlags(declaration, ast.ModifierFlagsNonPublicAccessibilityModifier)
80278039
// (1) Public constructors and (2) constructor functions are always accessible.
8028-
if modifiers == 0 || ast.IsConstructorDeclaration(declaration) {
8040+
if modifiers == 0 || !ast.IsConstructorDeclaration(declaration) {
80298041
return true
80308042
}
80318043
declaringClassDeclaration := getClassLikeDeclarationOfSymbol(declaration.Parent.Symbol())
@@ -9619,7 +9631,7 @@ func (c *Checker) isAritySmaller(signature *Signature, target *ast.Node) bool {
96199631
}
96209632
targetParameterCount++
96219633
}
9622-
if len(parameters) != 0 && parameterIsThisKeyword(parameters[0]) {
9634+
if len(parameters) != 0 && ast.IsThisParameter(parameters[0]) {
96239635
targetParameterCount--
96249636
}
96259637
return !c.hasEffectiveRestParameter(signature) && c.getParameterCount(signature) < targetParameterCount
@@ -10449,7 +10461,7 @@ func (c *Checker) checkPropertyAccessChain(node *ast.Node, checkMode CheckMode)
1044910461
}
1045010462

1045110463
func (c *Checker) checkPropertyAccessExpressionOrQualifiedName(node *ast.Node, left *ast.Node, leftType *Type, right *ast.Node, checkMode CheckMode, writeOnly bool) *Type {
10452-
parentSymbol := c.typeNodeLinks.Get(node).resolvedSymbol
10464+
parentSymbol := c.typeNodeLinks.Get(left).resolvedSymbol
1045310465
assignmentKind := getAssignmentTargetKind(node)
1045410466
widenedType := leftType
1045510467
if assignmentKind != AssignmentKindNone || c.isMethodAccessForCall(node) {
@@ -11521,7 +11533,8 @@ func (c *Checker) checkBinaryLikeExpression(left *ast.Node, operatorToken *ast.N
1152111533
ast.KindGreaterThanGreaterThanGreaterThanEqualsToken:
1152211534
rhsEval := c.evaluate(right, right)
1152311535
if numValue, ok := rhsEval.Value.(jsnum.Number); ok && numValue.Abs() >= 32 {
11524-
c.errorOrSuggestion(ast.IsEnumMember(ast.WalkUpParenthesizedExpressions(right.Parent.Parent)), errorNode, diagnostics.This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2, scanner.GetTextOfNode(left), scanner.TokenToString(operator), (numValue / 32).Floor())
11536+
// Elevate from suggestion to error within an enum member
11537+
c.errorOrSuggestion(ast.IsEnumMember(ast.WalkUpParenthesizedExpressions(right.Parent.Parent)), errorNode, diagnostics.This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2, scanner.GetTextOfNode(left), scanner.TokenToString(operator), numValue.Remainder(32))
1152511538
}
1152611539
}
1152711540
}
@@ -15014,7 +15027,7 @@ func (c *Checker) getTypeOfVariableOrParameterOrPropertyWorker(symbol *ast.Symbo
1501415027
case ast.KindPropertyAssignment:
1501515028
result = c.checkPropertyAssignment(declaration, CheckModeNormal)
1501615029
case ast.KindShorthandPropertyAssignment:
15017-
result = c.checkExpressionForMutableLocation(declaration, CheckModeNormal)
15030+
result = c.checkExpressionForMutableLocation(declaration.Name(), CheckModeNormal)
1501815031
case ast.KindMethodDeclaration:
1501915032
result = c.checkObjectLiteralMethod(declaration, CheckModeNormal)
1502015033
case ast.KindExportAssignment:
@@ -17983,7 +17996,7 @@ func (c *Checker) getSignaturesOfSymbol(symbol *ast.Symbol) []*Signature {
1798317996
}
1798417997
}
1798517998
// If this is a function or method declaration, get the signature from the @type tag for the sake of optional parameters.
17986-
// Exclude contextually-typed kinds because we already apply the @type tag to the context, plus applying it here to the initializer would supress checks that the two are compatible.
17999+
// Exclude contextually-typed kinds because we already apply the @type tag to the context, plus applying it here to the initializer would suppress checks that the two are compatible.
1798718000
result = append(result, c.getSignatureFromDeclaration(decl))
1798818001
}
1798918002
return result
@@ -18245,7 +18258,7 @@ func getEffectiveSetAccessorTypeAnnotationNode(node *ast.Node) *ast.Node {
1824518258
func getSetAccessorValueParameter(accessor *ast.Node) *ast.Node {
1824618259
parameters := accessor.Parameters()
1824718260
if len(parameters) > 0 {
18248-
hasThis := len(parameters) == 2 && parameterIsThisKeyword(parameters[0])
18261+
hasThis := len(parameters) == 2 && ast.IsThisParameter(parameters[0])
1824918262
return parameters[core.IfElse(hasThis, 1, 0)]
1825018263
}
1825118264
return nil
@@ -20228,7 +20241,7 @@ func (c *Checker) instantiateTypeWithAlias(t *Type, m *TypeMapper, alias *TypeAl
2022820241
}
2022920242
if c.instantiationDepth == 100 || c.instantiationCount >= 5_000_000 {
2023020243
// We have reached 100 recursive type instantiations, or 5M type instantiations caused by the same statement
20231-
// or expression. There is a very high likelyhood we're dealing with a combination of infinite generic types
20244+
// or expression. There is a very high likelihood we're dealing with a combination of infinite generic types
2023220245
// that perpetually generate new type identities, so we stop the recursion here by yielding the error type.
2023320246
c.error(c.currentNode, diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite)
2023420247
return c.errorType
@@ -20451,6 +20464,20 @@ func (c *Checker) getObjectTypeInstantiation(t *Type, m *TypeMapper, alias *Type
2045120464
result = c.instantiateAnonymousType(target, newMapper, newAlias)
2045220465
}
2045320466
data.instantiations[key] = result
20467+
if result.flags&TypeFlagsObjectFlagsType != 0 && result.objectFlags&ObjectFlagsCouldContainTypeVariablesComputed == 0 {
20468+
// if `result` is one of the object types we tried to make (it may not be, due to how `instantiateMappedType` works), we can carry forward the type variable containment check from the input type arguments
20469+
resultCouldContainObjectFlags := core.Some(typeArguments, c.couldContainTypeVariables)
20470+
if result.objectFlags&ObjectFlagsCouldContainTypeVariablesComputed == 0 {
20471+
if result.objectFlags&(ObjectFlagsMapped|ObjectFlagsAnonymous|ObjectFlagsReference) != 0 {
20472+
result.objectFlags |= ObjectFlagsCouldContainTypeVariablesComputed | core.IfElse(resultCouldContainObjectFlags, ObjectFlagsCouldContainTypeVariables, 0)
20473+
} else {
20474+
// If none of the type arguments for the outer type parameters contain type variables, it follows
20475+
// that the instantiated type doesn't reference type variables.
20476+
// Intrinsics have `CouldContainTypeVariablesComputed` pre-set, so this should only cover unions and intersections resulting from `instantiateMappedType`
20477+
result.objectFlags |= core.IfElse(!resultCouldContainObjectFlags, ObjectFlagsCouldContainTypeVariablesComputed, 0)
20478+
}
20479+
}
20480+
}
2045420481
}
2045520482
return result
2045620483
}
@@ -21885,6 +21912,7 @@ func (c *Checker) createComputedEnumType(symbol *ast.Symbol) *Type {
2188521912
freshType := c.newLiteralType(TypeFlagsEnum, nil, regularType)
2188621913
freshType.symbol = symbol
2188721914
regularType.AsLiteralType().freshType = freshType
21915+
freshType.AsLiteralType().freshType = freshType
2188821916
return regularType
2188921917
}
2189021918

internal/checker/emitresolver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (r *emitResolver) isValueAliasDeclarationWorker(node *ast.Node) bool {
8181
core.Some(exportClause.AsNamedExports().Elements.Nodes, r.isValueAliasDeclaration))
8282
case ast.KindExportAssignment:
8383
if node.AsExportAssignment().Expression != nil && node.AsExportAssignment().Expression.Kind == ast.KindIdentifier {
84-
return r.isAliasResolvedToValue(c.getSymbolOfDeclaration(node) /*excludeTypeOnlyValues*/, true)
84+
return r.isAliasResolvedToValue(c.getSymbolOfDeclaration(node), true /*excludeTypeOnlyValues*/)
8585
}
8686
return true
8787
}
@@ -97,7 +97,7 @@ func (r *emitResolver) isAliasResolvedToValue(symbol *ast.Symbol, excludeTypeOnl
9797
if container := ast.GetSourceFileOfNode(symbol.ValueDeclaration); container != nil {
9898
fileSymbol := c.getSymbolOfDeclaration(container.AsNode())
9999
// Ensures cjs export assignment is setup, since this symbol may point at, and merge with, the file itself.
100-
// If we don't, the merge may not have yet occured, and the flags check below will be missing flags that
100+
// If we don't, the merge may not have yet occurred, and the flags check below will be missing flags that
101101
// are added as a result of the merge.
102102
c.resolveExternalModuleSymbol(fileSymbol, false /*dontResolveAlias*/)
103103
}
@@ -166,7 +166,7 @@ func (r *emitResolver) GetExternalModuleFileFromDeclaration(node *ast.Node) *ast
166166

167167
func (r *emitResolver) getReferenceResolver() binder.ReferenceResolver {
168168
if r.referenceResolver == nil {
169-
r.referenceResolver = binder.NewReferenceResolver(binder.ReferenceResolverHooks{
169+
r.referenceResolver = binder.NewReferenceResolver(r.checker.compilerOptions, binder.ReferenceResolverHooks{
170170
ResolveName: r.checker.resolveName,
171171
GetResolvedSymbol: r.checker.getResolvedSymbol,
172172
GetMergedSymbol: r.checker.getMergedSymbol,

0 commit comments

Comments
 (0)