Skip to content

Commit ff025b3

Browse files
committed
fix tests
1 parent 54183fd commit ff025b3

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41191,7 +41191,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4119141191
switch (node.kind) {
4119241192
case SyntaxKind.ClassDeclaration:
4119341193
case SyntaxKind.ClassExpression:
41194-
if (checkUninitialized) {
41194+
if (checkUnused) {
4119541195
checkUnusedClassMembers(node, addDiagnostic);
4119641196
checkUnusedTypeParameters(node, addDiagnostic);
4119741197
}

tests/baselines/reference/unusedLocalsInMethod4.errors.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ unusedLocalsInMethod4.ts(57,9): error TS2454: Variable 'x' is used before being
8787
}
8888

8989
function f3() {
90-
let x: number[];
90+
let x: number[]; // should error
9191
~
9292
!!! error TS2454: Variable 'x' is used before being assigned.
9393
function foo() {
@@ -97,7 +97,7 @@ unusedLocalsInMethod4.ts(57,9): error TS2454: Variable 'x' is used before being
9797
}
9898

9999
function f4() {
100-
let x: number;
100+
let x: number; // should error
101101
~
102102
!!! error TS2454: Variable 'x' is used before being assigned.
103103
return {
@@ -107,7 +107,7 @@ unusedLocalsInMethod4.ts(57,9): error TS2454: Variable 'x' is used before being
107107
};
108108
}
109109

110-
declare let x: number;
110+
declare let x: number; // should error
111111
function f5() {
112112
x.toString();
113113
}

tests/baselines/reference/unusedLocalsInMethod4.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,23 @@ function f2<T, NonNull extends {}>() {
4949
}
5050

5151
function f3() {
52-
let x: number[];
52+
let x: number[]; // should error
5353
function foo() {
5454
x.toString();
5555
}
5656
foo();
5757
}
5858

5959
function f4() {
60-
let x: number;
60+
let x: number; // should error
6161
return {
6262
foo() {
6363
return x.toString();
6464
}
6565
};
6666
}
6767

68-
declare let x: number;
68+
declare let x: number; // should error
6969
function f5() {
7070
x.toString();
7171
}
@@ -120,14 +120,14 @@ function f2() {
120120
console.log(x9);
121121
}
122122
function f3() {
123-
var x;
123+
var x; // should error
124124
function foo() {
125125
x.toString();
126126
}
127127
foo();
128128
}
129129
function f4() {
130-
var x;
130+
var x; // should error
131131
return {
132132
foo: function () {
133133
return x.toString();

tests/baselines/reference/unusedLocalsInMethod4.symbols

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function f2<T, NonNull extends {}>() {
188188
function f3() {
189189
>f3 : Symbol(f3, Decl(unusedLocalsInMethod4.ts, 45, 1))
190190

191-
let x: number[];
191+
let x: number[]; // should error
192192
>x : Symbol(x, Decl(unusedLocalsInMethod4.ts, 48, 7))
193193

194194
function foo() {
@@ -206,7 +206,7 @@ function f3() {
206206
function f4() {
207207
>f4 : Symbol(f4, Decl(unusedLocalsInMethod4.ts, 53, 1))
208208

209-
let x: number;
209+
let x: number; // should error
210210
>x : Symbol(x, Decl(unusedLocalsInMethod4.ts, 56, 7))
211211

212212
return {
@@ -221,7 +221,7 @@ function f4() {
221221
};
222222
}
223223

224-
declare let x: number;
224+
declare let x: number; // should error
225225
>x : Symbol(x, Decl(unusedLocalsInMethod4.ts, 64, 11))
226226

227227
function f5() {

tests/baselines/reference/unusedLocalsInMethod4.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function f2<T, NonNull extends {}>() {
199199
function f3() {
200200
>f3 : () => void
201201

202-
let x: number[];
202+
let x: number[]; // should error
203203
>x : number[]
204204

205205
function foo() {
@@ -219,7 +219,7 @@ function f3() {
219219
function f4() {
220220
>f4 : () => { foo(): string; }
221221

222-
let x: number;
222+
let x: number; // should error
223223
>x : number
224224

225225
return {
@@ -237,7 +237,7 @@ function f4() {
237237
};
238238
}
239239

240-
declare let x: number;
240+
declare let x: number; // should error
241241
>x : number
242242

243243
function f5() {

0 commit comments

Comments
 (0)