diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7d3d037b2a6..6a42774a8c2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -29986,8 +29986,10 @@ namespace ts { function checkAliasSymbol(node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportSpecifier | ExportSpecifier) { const symbol = getSymbolOfNode(node); const target = resolveAlias(symbol); - if (target !== unknownSymbol) { - // For external modules symbol represent local symbol for an alias. + + const shouldSkipWithJSExpandoTargets = symbol.flags & SymbolFlags.Assignment; + if (!shouldSkipWithJSExpandoTargets && target !== unknownSymbol) { + // For external modules symbol represents local symbol for an alias. // This local symbol will merge any other local declarations (excluding other aliases) // and symbol.flags will contains combined representation for all merged declaration. // Based on symbol.flags we can compute a set of excluded meanings (meaning that resolved alias should not have, diff --git a/src/compiler/debug.ts b/src/compiler/debug.ts index ee6847133c1..c90f4d1fb01 100644 --- a/src/compiler/debug.ts +++ b/src/compiler/debug.ts @@ -258,4 +258,4 @@ namespace ts { isDebugInfoEnabled = true; } } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/propertyAssignmentOnImportedSymbol.errors.txt b/tests/baselines/reference/propertyAssignmentOnImportedSymbol.errors.txt deleted file mode 100644 index ee17bd087a1..00000000000 --- a/tests/baselines/reference/propertyAssignmentOnImportedSymbol.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/salsa/bug24658.js(1,10): error TS2440: Import declaration conflicts with local declaration of 'hurk'. - - -==== tests/cases/conformance/salsa/mod1.js (0 errors) ==== - export var hurk = {} -==== tests/cases/conformance/salsa/bug24658.js (1 errors) ==== - import { hurk } from './mod1' - ~~~~ -!!! error TS2440: Import declaration conflicts with local declaration of 'hurk'. - hurk.expando = 4 - \ No newline at end of file