From c68caa00db76e5a4e2be78deb1deb19ee17e2078 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 8 Jan 2026 02:02:44 +0000 Subject: [PATCH] Fix mistakes. --- tests/cases/compiler/capturedLetConstInLoop5.ts | 1 - tests/cases/compiler/protectedMembers.ts | 4 ++-- .../typeArgumentInferenceConstructSignatures.ts | 16 ++++++++-------- .../asiPreventsParsingAsInterface05.ts | 2 +- .../conformance/types/rest/objectRestNegative.ts | 2 +- .../assignmentCompatWithStringIndexer.ts | 6 ++++-- .../genericCallWithGenericSignatureArguments2.ts | 2 +- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/cases/compiler/capturedLetConstInLoop5.ts b/tests/cases/compiler/capturedLetConstInLoop5.ts index b55902558c7..5eedd5aac85 100644 --- a/tests/cases/compiler/capturedLetConstInLoop5.ts +++ b/tests/cases/compiler/capturedLetConstInLoop5.ts @@ -267,7 +267,6 @@ function foo7_c(x) { function foo8_c(x) { for (const y = 0; y < 1;) { const x = 1; - var var v = x; (function() { return x + y + v }); (() => x + y + v); diff --git a/tests/cases/compiler/protectedMembers.ts b/tests/cases/compiler/protectedMembers.ts index e2a8fbc574c..bf3e32a6534 100644 --- a/tests/cases/compiler/protectedMembers.ts +++ b/tests/cases/compiler/protectedMembers.ts @@ -1,7 +1,7 @@ // Class with protected members class C1 { protected x!: number; - protected static sx!: number; + protected static sx: number; protected f() { return this.x; } @@ -23,7 +23,7 @@ class C2 extends C1 { // Derived class making protected members public class C3 extends C2 { x!: number; - static sx!: number; + static sx: number f() { return super.f(); } diff --git a/tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts b/tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts index 8692cb5d09b..a05e6a946d6 100644 --- a/tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts +++ b/tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts @@ -95,7 +95,7 @@ interface someGenerics8 { new (n: T): T; } declare var someGenerics8: someGenerics8; -declare var x = new someGenerics8(someGenerics7); +var x = new someGenerics8(someGenerics7); new x(null, null, null); // Generic call with multiple parameters of generic type passed arguments with no best common type @@ -103,9 +103,9 @@ interface someGenerics9 { new (a: T, b: T, c: T): T; } declare var someGenerics9: someGenerics9; -declare var a9a = new someGenerics9('', 0, []); +var a9a = new someGenerics9('', 0, []); declare var a9a: {}; -declare var a9b = new someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); +var a9b = new someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); declare var a9b: { a?: number; b?: string; }; // Generic call with multiple parameters of generic type passed arguments with multiple best common types @@ -117,21 +117,21 @@ interface A92 { x: number; z?: Window; } -declare var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); +var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); declare var a9e: {}; -declare var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); +var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); declare var a9f: A92; // Generic call with multiple parameters of generic type passed arguments with a single best common type -declare var a9d = new someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); +var a9d = new someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); declare var a9d: { x: number; }; // Generic call with multiple parameters of generic type where one argument is of type 'any' declare var anyVar: any; -declare var a = new someGenerics9(7, anyVar, 4); +var a = new someGenerics9(7, anyVar, 4); declare var a: any; // Generic call with multiple parameters of generic type where one argument is [] and the other is not 'any' -declare var arr = new someGenerics9([], null, undefined); +var arr = new someGenerics9([], null, undefined); declare var arr: any[]; diff --git a/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts index e278da96daa..b60410d91d0 100644 --- a/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts +++ b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts @@ -1,6 +1,6 @@ "use strict" -declare var interface: number; +var interface: number = 123; // 'interface' is a strict mode reserved word, and so it would be permissible // to allow 'interface' and the name of the interface to be on separate lines; diff --git a/tests/cases/conformance/types/rest/objectRestNegative.ts b/tests/cases/conformance/types/rest/objectRestNegative.ts index 3ea2b3b1208..1ccea201f8e 100644 --- a/tests/cases/conformance/types/rest/objectRestNegative.ts +++ b/tests/cases/conformance/types/rest/objectRestNegative.ts @@ -14,5 +14,5 @@ function generic(t: T) { return rest; } -let rest: { b: string } = { b: "" } +let rest: { b: string } = { b: "" }; ({a, ...rest.b + rest.b} = o); diff --git a/tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts b/tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts index fa0f66b5028..42279a548fa 100644 --- a/tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts +++ b/tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts @@ -46,8 +46,10 @@ namespace Generics { a3 = b3; // error b3 = a3; // error - declare var b4: { [x: string]: Derived2; }; + var b4: { [x: string]: Derived2; }; a3 = b4; // error b4 = a3; // error } -} \ No newline at end of file +} + +let x!: string = 123 \ No newline at end of file diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts b/tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts index 908263dc1ed..3e0bf3d188f 100644 --- a/tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts +++ b/tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts @@ -64,7 +64,7 @@ namespace TU { enum E { A } enum F { A } - function foo3(x: T, a: (x: T) => T, b: (x: any) => any) { + function foo3(x: T, a: (x: T) => T, b: (x: U) => U) { var r!: (x: T) => T; return r; }