Skip to content
Open
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
6 changes: 5 additions & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15697,7 +15697,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
else if (prop.valueDeclaration && prop.valueDeclaration !== firstValueDeclaration) {
hasNonUniformValueDeclaration = true;
}
declarations = addRange(declarations, prop.declarations);
if (prop.declarations) {
for (const d of prop.declarations) {
declarations = appendIfUnique(declarations, d);
}
}
const type = getTypeOfSymbol(prop);
if (!firstType) {
firstType = type;
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/arrayDestructuringInSwitch1.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export function evaluate(expression: Expression): boolean {

case 'and': {
return operands.every((child) => evaluate(child));
>operands.every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>operands.every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>operands : Symbol(operands, Decl(arrayDestructuringInSwitch1.ts, 5, 20))
>every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>child : Symbol(child, Decl(arrayDestructuringInSwitch1.ts, 8, 31))
>evaluate : Symbol(evaluate, Decl(arrayDestructuringInSwitch1.ts, 1, 84))
>child : Symbol(child, Decl(arrayDestructuringInSwitch1.ts, 8, 31))
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/arraySlice.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var arr: string[] | number[];
>arr : Symbol(arr, Decl(arraySlice.ts, 0, 3))

arr.splice(1, 1);
>arr.splice : Symbol(Array.splice, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>arr.splice : Symbol(Array.splice, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>arr : Symbol(arr, Decl(arraySlice.ts, 0, 3))
>splice : Symbol(Array.splice, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>splice : Symbol(Array.splice, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

12 changes: 6 additions & 6 deletions tests/baselines/reference/bestChoiceType.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// Repro from #10041

(''.match(/ /) || []).map(s => s.toLowerCase());
>(''.match(/ /) || []).map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>(''.match(/ /) || []).map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>''.match : Symbol(String.match, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
>match : Symbol(String.match, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>s : Symbol(s, Decl(bestChoiceType.ts, 2, 26))
>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --))
>s : Symbol(s, Decl(bestChoiceType.ts, 2, 26))
Expand All @@ -29,9 +29,9 @@ function f1() {

let z = y.map(s => s.toLowerCase());
>z : Symbol(z, Decl(bestChoiceType.ts, 9, 7))
>y.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>y.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>y : Symbol(y, Decl(bestChoiceType.ts, 8, 7))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>s : Symbol(s, Decl(bestChoiceType.ts, 9, 18))
>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --))
>s : Symbol(s, Decl(bestChoiceType.ts, 9, 18))
Expand All @@ -53,9 +53,9 @@ function f2() {

let z = y.map(s => s.toLowerCase());
>z : Symbol(z, Decl(bestChoiceType.ts, 15, 7))
>y.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>y.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>y : Symbol(y, Decl(bestChoiceType.ts, 14, 7))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>s : Symbol(s, Decl(bestChoiceType.ts, 15, 18))
>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --))
>s : Symbol(s, Decl(bestChoiceType.ts, 15, 18))
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/bivariantInferences.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ declare const b: (string | number)[] | null[] | undefined[] | {}[];

let x = a.equalsShallow(b);
>x : Symbol(x, Decl(bivariantInferences.ts, 9, 3))
>a.equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20))
>a.equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20))
>a : Symbol(a, Decl(bivariantInferences.ts, 6, 13))
>equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20))
>equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20))
>b : Symbol(b, Decl(bivariantInferences.ts, 7, 13))

4 changes: 2 additions & 2 deletions tests/baselines/reference/callsOnComplexSignatures.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ function test3(items: string[] | number[]) {
>items : Symbol(items, Decl(callsOnComplexSignatures.tsx, 36, 15))

items.forEach(item => console.log(item));
>items.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>items.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
>items : Symbol(items, Decl(callsOnComplexSignatures.tsx, 36, 15))
>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
>item : Symbol(item, Decl(callsOnComplexSignatures.tsx, 37, 18))
>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
>console : Symbol(console, Decl(lib.dom.d.ts, --, --))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ declare const y: never[] | string[];

export const yThen = y.map(item => item.length);
>yThen : Symbol(yThen, Decl(one.ts, 1, 12))
>y.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>y.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>y : Symbol(y, Decl(one.ts, 0, 13))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>item : Symbol(item, Decl(one.ts, 1, 27))
>item.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --))
>item : Symbol(item, Decl(one.ts, 1, 27))
Expand All @@ -20,9 +20,9 @@ declare const y: number[][] | string[];

export const yThen = y.map(item => item.length);
>yThen : Symbol(yThen, Decl(two.ts, 1, 12))
>y.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>y.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>y : Symbol(y, Decl(two.ts, 0, 13))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
>item : Symbol(item, Decl(two.ts, 1, 27))
>item.length : Symbol(length, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>item : Symbol(item, Decl(two.ts, 1, 27))
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/controlFlowArrayErrors.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ function f6() {
>x : Symbol(x, Decl(controlFlowArrayErrors.ts, 37, 7))

x.push(99); // Error
>x.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>x.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>x : Symbol(x, Decl(controlFlowArrayErrors.ts, 37, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
}

function f7() {
Expand Down
Loading
Loading