Re-add undefined assignability check#53561
Re-add undefined assignability check#53561MariaSolOs wants to merge 2 commits intomicrosoft:mainfrom
undefined assignability check#53561Conversation
| @@ -221,6 +222,8 @@ tests/cases/conformance/types/unknown/unknownType1.ts(181,5): error TS2322: Type | |||
| // Functions with unknown return type don't need return expressions | |||
|
|
|||
| function f27(): unknown { | |||
There was a problem hiding this comment.
Just to be sure: This error should be emitted because noImplicitReturns is true by default right?
There was a problem hiding this comment.
Actually no, this error is issued regardless of noImplicitReturns. It occurs when there are no return statements at all in the function body (i.e. when hasExplicitReturn is false).
There was a problem hiding this comment.
I'm so confused. Can we get a playground link of what was desirable in TS 5.0, but is now incorrect in nightly?
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
|
Can you explicitly add the test from: #53490 (comment) |
Will do, but why didn't this test catch it? |
|
Hm, that is effectively the right test, yes. It sounds like maybe everyone has a different idea about the desired behavior? Or, is this test's settings matrix missing |
Follow up to #53490 (refer to @ahejlsberg's comment).