12 lines
639 B
Text
12 lines
639 B
Text
|
tests/cases/compiler/indexSignatureWithInitializer1.ts(2,4): error TS1020: An index signature parameter cannot have an initializer.
|
||
|
tests/cases/compiler/indexSignatureWithInitializer1.ts(2,4): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||
|
|
||
|
|
||
|
==== tests/cases/compiler/indexSignatureWithInitializer1.ts (2 errors) ====
|
||
|
class C {
|
||
|
[a: number = 1]: number;
|
||
|
~
|
||
|
!!! error TS1020: An index signature parameter cannot have an initializer.
|
||
|
~~~~~~~~~~~~~
|
||
|
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||
|
}
|