33 lines
No EOL
1.2 KiB
Text
33 lines
No EOL
1.2 KiB
Text
tests/cases/compiler/indexSignatureTypeCheck.ts(14,6): error TS1019: An index signature parameter cannot have a question mark.
|
|
tests/cases/compiler/indexSignatureTypeCheck.ts(15,9): error TS1017: An index signature cannot have a rest parameter.
|
|
tests/cases/compiler/indexSignatureTypeCheck.ts(16,6): error TS1096: An index signature must have exactly one parameter.
|
|
tests/cases/compiler/indexSignatureTypeCheck.ts(17,6): error TS1096: An index signature must have exactly one parameter.
|
|
|
|
|
|
==== tests/cases/compiler/indexSignatureTypeCheck.ts (4 errors) ====
|
|
interface IPropertySet {
|
|
|
|
[index: string]: any;
|
|
|
|
}
|
|
|
|
|
|
var ps: IPropertySet = null;
|
|
var index: any = "hello";
|
|
ps[index] = 12;
|
|
|
|
|
|
interface indexErrors {
|
|
[p2?: string];
|
|
~~
|
|
!!! error TS1019: An index signature parameter cannot have a question mark.
|
|
[...p3: any[]];
|
|
~~
|
|
!!! error TS1017: An index signature cannot have a rest parameter.
|
|
[p4: string, p5?: string];
|
|
~~
|
|
!!! error TS1096: An index signature must have exactly one parameter.
|
|
[p6: string, ...p7: any[]];
|
|
~~
|
|
!!! error TS1096: An index signature must have exactly one parameter.
|
|
} |