tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(13,14): error TS2540: Cannot assign to 'x' because it is a read-only property.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(33,7): error TS2415: Class 'E' incorrectly extends base class 'D'.
  Property 'x' is private in type 'D' but not in type 'E'.


==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts (2 errors) ====
    // Tests that readonly parameter properties behave like regular readonly properties
    
    class A {
        constructor(readonly x: number) {
            this.x = 0;
        }
    }
    
    class B extends A {
        constructor(x: number) {
            super(x);
            // Fails, x is readonly
            this.x = 1;
                 ~
!!! error TS2540: Cannot assign to 'x' because it is a read-only property.
        }
    }
    
    class C extends A {
        // This is the usual behavior of readonly properties:
        // if one is redeclared in a base class, then it can be assigned to.
        constructor(readonly x: number) {
            super(x);
            this.x = 1;
        }
    }
    
    class D {
        constructor(private readonly x: number) {
            this.x = 0;
        }
    }
    
    // Fails, can't redeclare readonly property
    class E extends D {
          ~
!!! error TS2415: Class 'E' incorrectly extends base class 'D'.
!!! error TS2415:   Property 'x' is private in type 'D' but not in type 'E'.
        constructor(readonly x: number) {
            super(x);
            this.x = 1;
        }
    }
    