Add fix for webpack history merge bug (#29339)
* Add fix for webpack history merge bug * Add test case
This commit is contained in:
parent
3f7357d37f
commit
4c9ad08610
5 changed files with 57 additions and 1 deletions
|
@ -8790,7 +8790,7 @@ namespace ts {
|
|||
|
||||
function getTypeReferenceTypeWorker(node: NodeWithTypeArguments, symbol: Symbol, typeArguments: Type[] | undefined): Type | undefined {
|
||||
if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
|
||||
if (symbol.valueDeclaration && isBinaryExpression(symbol.valueDeclaration.parent)) {
|
||||
if (symbol.valueDeclaration && symbol.valueDeclaration.parent && isBinaryExpression(symbol.valueDeclaration.parent)) {
|
||||
const jsdocType = getJSDocTypeReference(node, symbol, typeArguments);
|
||||
if (jsdocType) {
|
||||
return jsdocType;
|
||||
|
|
14
tests/baselines/reference/noCrashUMDMergedWithGlobalValue.js
Normal file
14
tests/baselines/reference/noCrashUMDMergedWithGlobalValue.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
//// [tests/cases/compiler/noCrashUMDMergedWithGlobalValue.ts] ////
|
||||
|
||||
//// [other.d.ts]
|
||||
export as namespace SomeInterface;
|
||||
export type Action = "PUSH" | "POP" | "REPLACE";
|
||||
|
||||
//// [main.ts]
|
||||
interface SomeInterface {
|
||||
readonly length: number;
|
||||
}
|
||||
declare const value: SomeInterface;
|
||||
|
||||
|
||||
//// [main.js]
|
|
@ -0,0 +1,18 @@
|
|||
=== /other.d.ts ===
|
||||
export as namespace SomeInterface;
|
||||
>SomeInterface : Symbol(SomeInterface, Decl(other.d.ts, 0, 0))
|
||||
|
||||
export type Action = "PUSH" | "POP" | "REPLACE";
|
||||
>Action : Symbol(Action, Decl(other.d.ts, 0, 34))
|
||||
|
||||
=== /main.ts ===
|
||||
interface SomeInterface {
|
||||
>SomeInterface : Symbol("/other", Decl(other.d.ts, 0, 0), Decl(main.ts, 0, 0))
|
||||
|
||||
readonly length: number;
|
||||
>length : Symbol(length, Decl(main.ts, 0, 25))
|
||||
}
|
||||
declare const value: SomeInterface;
|
||||
>value : Symbol(value, Decl(main.ts, 3, 13))
|
||||
>SomeInterface : Symbol("/other", Decl(other.d.ts, 0, 0), Decl(main.ts, 0, 0))
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
=== /other.d.ts ===
|
||||
export as namespace SomeInterface;
|
||||
>SomeInterface : typeof import("/other")
|
||||
|
||||
export type Action = "PUSH" | "POP" | "REPLACE";
|
||||
>Action : Action
|
||||
|
||||
=== /main.ts ===
|
||||
interface SomeInterface {
|
||||
readonly length: number;
|
||||
>length : number
|
||||
}
|
||||
declare const value: SomeInterface;
|
||||
>value : import("/other")
|
||||
|
9
tests/cases/compiler/noCrashUMDMergedWithGlobalValue.ts
Normal file
9
tests/cases/compiler/noCrashUMDMergedWithGlobalValue.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
//@filename: /other.d.ts
|
||||
export as namespace SomeInterface;
|
||||
export type Action = "PUSH" | "POP" | "REPLACE";
|
||||
|
||||
//@filename: /main.ts
|
||||
interface SomeInterface {
|
||||
readonly length: number;
|
||||
}
|
||||
declare const value: SomeInterface;
|
Loading…
Reference in a new issue