diff --git a/tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts b/tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts index 996560385d8..2033ef743a4 100644 --- a/tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts +++ b/tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts @@ -5,6 +5,6 @@ enum E { b = 1 } var x = E; -var x: { a: E; b: E;[x: number]: string; }; // Shouldnt error +var x: { readonly a: E; readonly b: E; readonly [x: number]: string; }; // Shouldnt error var y = E; -var y: { a: E; b: E;[x: number]: string;[x: number]: string } // two errors: the types are not identical and duplicate signatures \ No newline at end of file +var y: { readonly a: E; readonly b: E; readonly [x: number]: string; readonly [x: number]: string } // two errors: the types are not identical and duplicate signatures \ No newline at end of file diff --git a/tests/cases/conformance/enums/enumBasics.ts b/tests/cases/conformance/enums/enumBasics.ts index 756e08e97af..1e134540713 100644 --- a/tests/cases/conformance/enums/enumBasics.ts +++ b/tests/cases/conformance/enums/enumBasics.ts @@ -11,10 +11,10 @@ var x: number = E1.A; // Enum object type is anonymous with properties of the enum type and numeric indexer var e = E1; var e: { - A: E1; - B: E1; - C: E1; - [n: number]: string; + readonly A: E1; + readonly B: E1; + readonly C: E1; + readonly [n: number]: string; }; var e: typeof E1; diff --git a/tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts b/tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts index 5a6bc87af36..af0622179ac 100644 --- a/tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts +++ b/tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts @@ -16,11 +16,11 @@ var callSig3: { num: (n: number) => string; }; // Get accessor only, type of the property is the annotated return type of the get accessor var getter1 = { get x(): string { return undefined; } }; -var getter1: { x: string; } +var getter1: { readonly x: string; } // Get accessor only, type of the property is the inferred return type of the get accessor var getter2 = { get x() { return ''; } }; -var getter2: { x: string; } +var getter2: { readonly x: string; } // Set accessor only, type of the property is the param type of the set accessor var setter1 = { set x(n: number) { } }; diff --git a/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlyGetter.ts b/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlyGetter.ts index 53f5e6988b7..a2e783d9ce0 100644 --- a/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlyGetter.ts +++ b/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlyGetter.ts @@ -9,7 +9,7 @@ ////var /*2*/x = point./*3*/x; goTo.marker('1'); -verify.quickInfoIs("function makePoint(x: number): {\n x: number;\n}", undefined); +verify.quickInfoIs("function makePoint(x: number): {\n readonly x: number;\n}", undefined); goTo.marker('2'); verify.quickInfoIs("var x: number", undefined); @@ -18,4 +18,4 @@ goTo.marker('3'); verify.memberListContains("x", "(property) x: number", undefined); goTo.marker('4'); -verify.quickInfoIs("var point: {\n x: number;\n}", undefined); +verify.quickInfoIs("var point: {\n readonly x: number;\n}", undefined);