2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/indexerAsOptional.ts(3,6): error TS1019: An index signature parameter cannot have a question mark.
|
|
|
|
tests/cases/compiler/indexerAsOptional.ts(8,6): error TS1019: An index signature parameter cannot have a question mark.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/indexerAsOptional.ts (2 errors) ====
|
|
|
|
interface indexSig {
|
|
|
|
//Index signatures can't be optional
|
|
|
|
[idx?: number]: any; //err
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1019: An index signature parameter cannot have a question mark.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
class indexSig2 {
|
|
|
|
//Index signatures can't be optional
|
|
|
|
[idx?: number]: any //err
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1019: An index signature parameter cannot have a question mark.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|