mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-23 19:07:27 -06:00
Merge pull request #32626 from orta/fix-31312
Fixes making changes on JS imports
This commit is contained in:
commit
9243415ead
@ -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,
|
||||
|
||||
@ -258,4 +258,4 @@ namespace ts {
|
||||
isDebugInfoEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user