18 lines
No EOL
536 B
Text
18 lines
No EOL
536 B
Text
==== tests/cases/compiler/stringIndexerAndConstructor.ts (2 errors) ====
|
|
class C {
|
|
[s: string]: number;
|
|
constructor() { }
|
|
static v() { }
|
|
}
|
|
|
|
interface I {
|
|
[s: string]: number;
|
|
(): boolean;
|
|
new (): boolean;
|
|
"": string;
|
|
~~~~~~~~~~~
|
|
!!! Property '""' of type 'string' is not assignable to string index type 'number'.
|
|
d: string;
|
|
~~~~~~~~~~
|
|
!!! Property 'd' of type 'string' is not assignable to string index type 'number'.
|
|
} |