==== tests/cases/compiler/stringIndexerConstrainsPropertyDeclarations.ts (22 errors) ====
    // String indexer types constrain the types of named properties in their containing type
    
    interface MyString extends String {
        foo: number;
    }
    
    class C {
        [x: string]: string;
    
        constructor() { } // ok
    
        a: string; // ok
        b: number; // error
        ~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(13,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        c: () => {} // error
        ~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(14,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        "d": string; // ok
        "e": number; // error
        ~~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(16,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        1.0: string; // ok
        2.0: number; // error
        ~~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(18,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        "3.0": string; // ok
        "4.0": number; // error
        ~~~~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(20,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        f: MyString; // error
        ~~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(21,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
    
        get X() { // ok
            return '';
        }
        set X(v) { } // ok
    
        foo() { // error
        ~~~~~~~~~~~~~~~~
            return '';
    ~~~~~~~~~~~~~~~~~~
        }
    ~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(28,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
    
        static sa: number; // ok
        static sb: string; // ok
    
        static foo() { } // ok
        static get X() { // ok
            return 1;
        }
    }
    
    interface I {
        [x: string]: string;
    
        a: string; // ok
        b: number; // error
        ~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(45,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        c: () => {} // error
        ~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(46,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        "d": string; // ok
        "e": number; // error
        ~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(48,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        1.0: string; // ok
        2.0: number; // error
        ~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        (): string; // ok
        (x): number // ok
        foo(): string; // error
        ~~~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(53,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        "3.0": string; // ok
        "4.0": number; // error
        ~~~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(55,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        f: MyString; // error
        ~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(56,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
    }
    
    var a: {
        [x: string]: string;
    
        a: string; // ok
        b: number; // error
        ~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(63,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        c: () => {} // error
        ~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(64,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        "d": string; // ok
        "e": number; // error
        ~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(66,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        1.0: string; // ok
        2.0: number; // error
        ~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        (): string; // ok
        (x): number // ok
        foo(): string; // error
        ~~~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(71,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        "3.0": string; // ok
        "4.0": number; // error
        ~~~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(73,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
        f: MyString; // error
        ~~~~~~~~~~~
!!! stringIndexerConstrainsPropertyDeclarations.ts(74,5): error TS2171: All named properties must be assignable to string indexer type 'string'.
    }
    
    // error
    var b: { [x: string]: string; } = {
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        a: '',
    ~~~~~~~~~~
        b: 1, 
    ~~~~~~~~~~
        c: () => { }, 
    ~~~~~~~~~~~~~~~~~~
        "d": '', 
    ~~~~~~~~~~~~~
        "e": 1, 
    ~~~~~~~~~~~~
        1.0: '',
    ~~~~~~~~~~~~
        2.0: 1, 
    ~~~~~~~~~~~~
        "3.0": '', 
    ~~~~~~~~~~~~~~~
        "4.0": 1, 
    ~~~~~~~~~~~~~~
        f: <MyString>null, 
    ~~~~~~~~~~~~~~~~~~~~~~~
    
    
        get X() { 
    ~~~~~~~~~~~~~~
            return '';
    ~~~~~~~~~~~~~~~~~~
        },
    ~~~~~~
        set X(v) { }, 
    ~~~~~~~~~~~~~~~~~~
        foo() { 
    ~~~~~~~~~~~~
            return '';
    ~~~~~~~~~~~~~~~~~~
        }
    ~~~~~
    }
    ~
!!! stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2012: Cannot convert '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; [x: string]: {}; }' to '{ [x: string]: string; }':
!!! 	Index signatures of types '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; [x: string]: {}; }' and '{ [x: string]: string; }' are incompatible.