Skip to content

Commit f01d913

Browse files
committed
Merge on top of strict:true
2 parents 7ae3376 + 5742ea7 commit f01d913

3,573 files changed

Lines changed: 78182 additions & 15568 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
899899
showInSimplifiedHelpView: true,
900900
category: Diagnostics.Type_Checking,
901901
description: Diagnostics.Enable_all_strict_type_checking_options,
902-
defaultValueDescription: false,
902+
defaultValueDescription: true,
903903
},
904904
{
905905
name: "noImplicitAny",

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9312,7 +9312,7 @@ export type StrictOptionName =
93129312

93139313
/** @internal */
93149314
export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean {
9315-
return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag];
9315+
return compilerOptions[flag] === undefined ? (compilerOptions.strict !== false) : !!compilerOptions[flag];
93169316
}
93179317

93189318
/** @internal */

tests/baselines/reference/2dArrays.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ class Board {
2424
ships: Ship[] = [];
2525
>ships : Ship[]
2626
> : ^^^^^^
27-
>[] : undefined[]
28-
> : ^^^^^^^^^^^
27+
>[] : never[]
28+
> : ^^^^^^^
2929

3030
cells: Cell[] = [];
3131
>cells : Cell[]
3232
> : ^^^^^^
33-
>[] : undefined[]
34-
> : ^^^^^^^^^^^
33+
>[] : never[]
34+
> : ^^^^^^^
3535

3636
private allShipsSunk() {
3737
>allShipsSunk : () => boolean

tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
1+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(5,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
2+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(6,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
13
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(10,19): error TS2304: Cannot find name 'T'.
4+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(15,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
5+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(16,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
26
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(20,12): error TS2304: Cannot find name 'T'.
37
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(22,23): error TS2304: Cannot find name 'T'.
8+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(23,9): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
9+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(24,9): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
10+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(30,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
11+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(31,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
412
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(35,26): error TS2304: Cannot find name 'T'.
13+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(40,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
14+
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(41,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
515
ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): error TS2304: Cannot find name 'T'.
616

717

8-
==== ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts (5 errors) ====
18+
==== ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts (15 errors) ====
919
// all expected to be errors
1020

1121
class clodule1<T>{
1222

1323
id: string;
24+
~~
25+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
1426
value: T;
27+
~~~~~
28+
!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
1529
}
1630

1731
namespace clodule1 {
@@ -23,7 +37,11 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err
2337
class clodule2<T>{
2438

2539
id: string;
40+
~~
41+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
2642
value: T;
43+
~~~~~
44+
!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
2745
}
2846

2947
namespace clodule2 {
@@ -35,14 +53,22 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err
3553
~
3654
!!! error TS2304: Cannot find name 'T'.
3755
id: string;
56+
~~
57+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
3858
value: U;
59+
~~~~~
60+
!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
3961
}
4062
}
4163

4264
class clodule3<T>{
4365

4466
id: string;
67+
~~
68+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
4569
value: T;
70+
~~~~~
71+
!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
4672
}
4773

4874
namespace clodule3 {
@@ -54,7 +80,11 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err
5480
class clodule4<T>{
5581

5682
id: string;
83+
~~
84+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
5785
value: T;
86+
~~~~~
87+
!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
5888
}
5989

6090
namespace clodule4 {

tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
2+
ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(3,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
13
ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'.
24
ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'.
35

46

5-
==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (2 errors) ====
7+
==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (4 errors) ====
68
class clodule<T> {
79
id: string;
10+
~~
11+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
812
value: T;
13+
~~~~~
14+
!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
915

1016
static fn<U>(id: U) { }
1117
~~

tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
2+
ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(3,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
13
ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'.
24
ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'.
35

46

5-
==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (2 errors) ====
7+
==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (4 errors) ====
68
class clodule<T> {
79
id: string;
10+
~~
11+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
812
value: T;
13+
~~~~~
14+
!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
915

1016
static fn(id: string) { }
1117
~~

tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
2+
ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(3,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
13
ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(11,24): error TS2341: Property 'sfn' is private and only accessible within class 'clodule<T>'.
24

35

4-
==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (1 errors) ====
6+
==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (3 errors) ====
57
class clodule<T> {
68
id: string;
9+
~~
10+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
711
value: T;
12+
~~~~~
13+
!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor.
814

915
private static sfn(id: string) { return 42; }
1016
}

tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ namespace Point {
3131
> : ^^^^^^^^^^^^
3232

3333
export function Origin() { return null; } //expected duplicate identifier error
34-
>Origin : () => any
35-
> : ^^^^^^^^^
34+
>Origin : () => null
35+
> : ^^^^^^^^^^
3636
}
3737

3838

tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.ts(2,22): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
2+
simple.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
23

34

45
==== class.ts (0 errors) ====
@@ -28,9 +29,11 @@ module.ts(2,22): error TS2433: A namespace declaration cannot be in a different
2829
var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
2930

3031

31-
==== simple.ts (0 errors) ====
32+
==== simple.ts (1 errors) ====
3233
class A {
3334
id: string;
35+
~~
36+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
3437
}
3538

3639
namespace A {

tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.ts(2,22): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
2+
simple.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
23

34

45
==== class.ts (0 errors) ====
@@ -28,9 +29,11 @@ module.ts(2,22): error TS2433: A namespace declaration cannot be in a different
2829
var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
2930

3031

31-
==== simple.ts (0 errors) ====
32+
==== simple.ts (1 errors) ====
3233
class A {
3334
id: string;
35+
~~
36+
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
3437
}
3538

3639
namespace A {

0 commit comments

Comments
 (0)