14 lines
476 B
Plaintext
14 lines
476 B
Plaintext
==== tests/cases/compiler/indexerAsOptional.ts (2 errors) ====
|
|
interface indexSig {
|
|
//Index signatures can't be optional
|
|
[idx?: number]: any; //err
|
|
~~~
|
|
!!! error TS1019: An index signature parameter cannot have a question mark.
|
|
}
|
|
|
|
class indexSig2 {
|
|
//Index signatures can't be optional
|
|
[idx?: number]: any //err
|
|
~~~
|
|
!!! error TS1019: An index signature parameter cannot have a question mark.
|
|
} |