Skip to content

Commit 40f9512

Browse files
committed
Address CR feedback
1 parent 7d54015 commit 40f9512

5 files changed

+14
-14
lines changed

tests/baselines/reference/functionsMissingReturnStatementsAndExpressionsStrictNullChecks.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressionsStrictNullChe
3535
~~~
3636
!!! error TS2322: Type '() => void' is not assignable to type '() => number | undefined'.
3737
!!! error TS2322: Type 'void' is not assignable to type 'number | undefined'.
38-
// Regular void function because contextual type for implicit return isn't just undefined
38+
// Error, regular void function because contextual type for implicit return isn't just undefined
3939
}
4040

4141
const f22: () => number = () => {
4242
~~~
4343
!!! error TS2322: Type '() => void' is not assignable to type '() => number'.
4444
!!! error TS2322: Type 'void' is not assignable to type 'number'.
45-
// Regular void function because contextual type for implicit return isn't just undefined
45+
// Error, regular void function because contextual type for implicit return isn't just undefined
4646
}
4747

4848
async function f30(): Promise<undefined> {

tests/baselines/reference/functionsMissingReturnStatementsAndExpressionsStrictNullChecks.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const f20: () => undefined = () => {
1616
}
1717

1818
const f21: () => undefined | number = () => {
19-
// Regular void function because contextual type for implicit return isn't just undefined
19+
// Error, regular void function because contextual type for implicit return isn't just undefined
2020
}
2121

2222
const f22: () => number = () => {
23-
// Regular void function because contextual type for implicit return isn't just undefined
23+
// Error, regular void function because contextual type for implicit return isn't just undefined
2424
}
2525

2626
async function f30(): Promise<undefined> {
@@ -72,10 +72,10 @@ const f20 = () => {
7272
// Ok, contextual type for implicit return is undefined
7373
};
7474
const f21 = () => {
75-
// Regular void function because contextual type for implicit return isn't just undefined
75+
// Error, regular void function because contextual type for implicit return isn't just undefined
7676
};
7777
const f22 = () => {
78-
// Regular void function because contextual type for implicit return isn't just undefined
78+
// Error, regular void function because contextual type for implicit return isn't just undefined
7979
};
8080
async function f30() {
8181
// Ok, return type allows implicit return of undefined

tests/baselines/reference/functionsMissingReturnStatementsAndExpressionsStrictNullChecks.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ const f20: () => undefined = () => {
2626
const f21: () => undefined | number = () => {
2727
>f21 : Symbol(f21, Decl(functionsMissingReturnStatementsAndExpressionsStrictNullChecks.ts, 16, 5))
2828

29-
// Regular void function because contextual type for implicit return isn't just undefined
29+
// Error, regular void function because contextual type for implicit return isn't just undefined
3030
}
3131

3232
const f22: () => number = () => {
3333
>f22 : Symbol(f22, Decl(functionsMissingReturnStatementsAndExpressionsStrictNullChecks.ts, 20, 5))
3434

35-
// Regular void function because contextual type for implicit return isn't just undefined
35+
// Error, regular void function because contextual type for implicit return isn't just undefined
3636
}
3737

3838
async function f30(): Promise<undefined> {

tests/baselines/reference/functionsMissingReturnStatementsAndExpressionsStrictNullChecks.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ const f20: () => undefined = () => {
2626

2727
const f21: () => undefined | number = () => {
2828
>f21 : () => undefined | number
29-
>() => { // Regular void function because contextual type for implicit return isn't just undefined} : () => void
29+
>() => { // Error, regular void function because contextual type for implicit return isn't just undefined} : () => void
3030

31-
// Regular void function because contextual type for implicit return isn't just undefined
31+
// Error, regular void function because contextual type for implicit return isn't just undefined
3232
}
3333

3434
const f22: () => number = () => {
3535
>f22 : () => number
36-
>() => { // Regular void function because contextual type for implicit return isn't just undefined} : () => void
36+
>() => { // Error, regular void function because contextual type for implicit return isn't just undefined} : () => void
3737

38-
// Regular void function because contextual type for implicit return isn't just undefined
38+
// Error, regular void function because contextual type for implicit return isn't just undefined
3939
}
4040

4141
async function f30(): Promise<undefined> {

tests/cases/compiler/functionsMissingReturnStatementsAndExpressionsStrictNullChecks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const f20: () => undefined = () => {
1919
}
2020

2121
const f21: () => undefined | number = () => {
22-
// Regular void function because contextual type for implicit return isn't just undefined
22+
// Error, regular void function because contextual type for implicit return isn't just undefined
2323
}
2424

2525
const f22: () => number = () => {
26-
// Regular void function because contextual type for implicit return isn't just undefined
26+
// Error, regular void function because contextual type for implicit return isn't just undefined
2727
}
2828

2929
async function f30(): Promise<undefined> {

0 commit comments

Comments
 (0)