Report error only on local declaration with additional related information (#49746)

* Add test where the errors are reported in different file
Test for #49739

* Report error only on local declaration with additional related information
Fixes #49739

* Handle existing tests
This commit is contained in:
Sheetal Nandi
2022-07-27 15:31:45 -07:00
committed by GitHub
parent c0461be025
commit 5b0eea48e9
14 changed files with 600 additions and 12 deletions

View File

@@ -0,0 +1,39 @@
// @target: es2015
// @Filename: index.ts
class Test extends Array1 {
[key: symbol]: string
}
// @Filename: other.ts
interface Array1<T> {
length: number;
[n: number]: T;
}
interface ArrayConstructor1 {
new(arrayLength?: number): Array1<any>;
}
declare var Array1: ArrayConstructor1;
// iterable.d.ts
interface Array1<T> {
[Symbol.iterator](): IterableIterator<T>;
}
// symbol.wellknown.d.ts
interface Array1<T> {
/**
* Returns an object whose properties have the value 'true'
* when they will be absent when used in a 'with' statement.
*/
[Symbol.unscopables](): {
copyWithin: boolean;
entries: boolean;
fill: boolean;
find: boolean;
findIndex: boolean;
keys: boolean;
values: boolean;
};
}

View File

@@ -0,0 +1,39 @@
// @target: es2015
// @Filename: other.ts
interface Array1<T> {
length: number;
[n: number]: T;
}
interface ArrayConstructor1 {
new(arrayLength?: number): Array1<any>;
}
declare var Array1: ArrayConstructor1;
// iterable.d.ts
interface Array1<T> {
[Symbol.iterator](): IterableIterator<T>;
}
// symbol.wellknown.d.ts
interface Array1<T> {
/**
* Returns an object whose properties have the value 'true'
* when they will be absent when used in a 'with' statement.
*/
[Symbol.unscopables](): {
copyWithin: boolean;
entries: boolean;
fill: boolean;
find: boolean;
findIndex: boolean;
keys: boolean;
values: boolean;
};
}
// @Filename: index.ts
class Test extends Array1 {
[key: symbol]: string
}