(moduleSymbol *ast.Symbol, targetSymbol *ast.Symbol, node *ast.Node, name *ast.Node)
| 14808 | } |
| 14809 | |
| 14810 | func (c *Checker) errorNoModuleMemberSymbol(moduleSymbol *ast.Symbol, targetSymbol *ast.Symbol, node *ast.Node, name *ast.Node) { |
| 14811 | if c.compilerOptions.NoCheck.IsTrue() { |
| 14812 | return |
| 14813 | } |
| 14814 | moduleName := c.getFullyQualifiedName(moduleSymbol, node) |
| 14815 | declarationName := scanner.DeclarationNameToString(name) |
| 14816 | var suggestion *ast.Symbol |
| 14817 | if ast.IsIdentifier(name) { |
| 14818 | suggestion = c.getSuggestedSymbolForNonexistentModule(name, targetSymbol) |
| 14819 | } |
| 14820 | if suggestion != nil { |
| 14821 | suggestionName := c.symbolToString(suggestion) |
| 14822 | diagnostic := c.error(name, diagnostics.X_0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName) |
| 14823 | if suggestion.ValueDeclaration != nil { |
| 14824 | diagnostic.AddRelatedInfo(createDiagnosticForNode(suggestion.ValueDeclaration, diagnostics.X_0_is_declared_here, suggestionName)) |
| 14825 | } |
| 14826 | } else { |
| 14827 | if moduleSymbol.Exports[ast.InternalSymbolNameDefault] != nil { |
| 14828 | c.error(name, diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName) |
| 14829 | } else { |
| 14830 | c.reportNonExportedMember(name, declarationName, moduleSymbol, moduleName) |
| 14831 | } |
| 14832 | } |
| 14833 | } |
| 14834 | |
| 14835 | func (c *Checker) reportNonExportedMember(name *ast.Node, declarationName string, moduleSymbol *ast.Symbol, moduleName string) { |
| 14836 | var localSymbol *ast.Symbol |
no test coverage detected