File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -797,18 +797,18 @@ func (b *Binder) bindModuleDeclaration(node *ast.Node) {
797
797
if ast .IsModuleAugmentationExternal (node ) {
798
798
b .declareModuleSymbol (node )
799
799
} else {
800
- var pattern core.Pattern
801
800
name := node .AsModuleDeclaration ().Name ()
801
+ symbol := b .declareSymbolAndAddToSymbolTable (node , ast .SymbolFlagsValueModule , ast .SymbolFlagsValueModuleExcludes )
802
+
802
803
if ast .IsStringLiteral (name ) {
803
- pattern = core .TryParsePattern (name .AsStringLiteral ().Text )
804
+ pattern : = core .TryParsePattern (name .AsStringLiteral ().Text )
804
805
if ! pattern .IsValid () {
806
+ // An invalid pattern - must have multiple wildcards.
805
807
b .errorOnFirstToken (name , diagnostics .Pattern_0_can_have_at_most_one_Asterisk_character , name .AsStringLiteral ().Text )
808
+ } else if pattern .StarIndex >= 0 {
809
+ b .file .PatternAmbientModules = append (b .file .PatternAmbientModules , & ast.PatternAmbientModule {Pattern : pattern , Symbol : symbol })
806
810
}
807
811
}
808
- symbol := b .declareSymbolAndAddToSymbolTable (node , ast .SymbolFlagsValueModule , ast .SymbolFlagsValueModuleExcludes )
809
- if pattern .IsValid () && pattern .StarIndex >= 0 {
810
- b .file .PatternAmbientModules = append (b .file .PatternAmbientModules , & ast.PatternAmbientModule {Pattern : pattern , Symbol : symbol })
811
- }
812
812
}
813
813
} else {
814
814
state := b .declareModuleSymbol (node )
You can’t perform that action at this time.
0 commit comments