Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20428,7 +20428,7 @@ namespace ts {
if (propType.symbol && propType.symbol.flags & SymbolFlags.Class) {
const name = prop.escapedName;
const symbol = resolveName(prop.valueDeclaration, name, SymbolFlags.Type, undefined, name, /*isUse*/ false);
if (symbol && propType.symbol !== symbol) {
if (symbol && symbol.declarations.some(d => d.kind === SyntaxKind.JSDocTypedefTag)) {
grammarErrorOnNode(symbol.declarations[0], Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(name));
return grammarErrorOnNode(prop.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(name));
}
Expand Down
18 changes: 18 additions & 0 deletions tests/baselines/reference/moduleExportAlias4.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
=== tests/cases/conformance/salsa/bug24024.js ===
// #24024
var wat = require('./bug24024')
>wat : Symbol(wat, Decl(bug24024.js, 1, 3))
>require : Symbol(require)
>'./bug24024' : Symbol("tests/cases/conformance/salsa/bug24024", Decl(bug24024.js, 0, 0))

module.exports = class C {}
>module : Symbol(export=, Decl(bug24024.js, 1, 31))
>exports : Symbol(export=, Decl(bug24024.js, 1, 31))
>C : Symbol(C, Decl(bug24024.js, 2, 16))

module.exports.D = class D { }
>module.exports : Symbol(D, Decl(bug24024.js, 2, 27))
>module : Symbol(module)
>D : Symbol(D, Decl(bug24024.js, 2, 27))
>D : Symbol(D, Decl(bug24024.js, 3, 18))

26 changes: 26 additions & 0 deletions tests/baselines/reference/moduleExportAlias4.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
=== tests/cases/conformance/salsa/bug24024.js ===
// #24024
var wat = require('./bug24024')
>wat : typeof C
>require('./bug24024') : typeof C
>require : any
>'./bug24024' : "./bug24024"

module.exports = class C {}
>module.exports = class C {} : typeof C
>module.exports : any
>module : any
>exports : any
>class C {} : typeof C
>C : typeof C

module.exports.D = class D { }
>module.exports.D = class D { } : typeof D
>module.exports.D : any
>module.exports : any
>module : any
>exports : any
>D : any
>class D { } : typeof D
>D : typeof D

8 changes: 8 additions & 0 deletions tests/cases/conformance/salsa/moduleExportAlias4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @checkJs: true
// @allowJS: true
// @noEmit: true
// @Filename: bug24024.js
// #24024
var wat = require('./bug24024')
module.exports = class C {}
module.exports.D = class D { }