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