Open ShuiRuTian opened 4 years ago
The reason is isMatchingReferenceDiscriminant
function return false at the second time. Declared type is no use here.
( I sneakily edited the issue body to be a twoslash compiler repro to test the bot )
@typescript-bot run repros
Heya @orta, I've started to run the code sample repros for you. Here's the link to my best guess at the log.
Think I've got the bugs down, @typescript-bot run repros
Heya @orta, I've started to run the code sample repros for you. Here's the link to my best guess at the log.
:wave: Hi, I'm the Repro bot. I can help narrow down and track compiler bugs across releases! This comment reflects the current state of the repro in the issue body running against the nightly TypeScript.
Issue body code block by @ShuiRuTian
:warning: Assertions:
(parameter) x: B
Version | Reproduction Outputs |
---|---|
4.2.2, 4.3.2, 4.4.2, 4.5.2, 4.6.2 |
:warning: Assertions:
|
TypeScript Version: 4.0
Search Terms:
Code
Expected behavior: the last x should be never.
Actual behavior: still B.
Playground Link: https://www.typescriptlang.org/play/index.html?ts=4.0.0-dev.20200615&ssl=1&ssc=1&pln=25&pc=2#code/JYOwLgpgTgZghgYwgAgIIG8BQyfLATwAcIAuAclTMwF9NNRJZEUAhLXPI0slq2zGAFcQCMMAD2IZHADOM6GAAUADxJwQ+AJTI1chTOTLkwA6gA+bOvyEixk5DHHiVJaRs2v1+ZO1zKA3DgA9EFu+Ni4svJQSsqa-hE4AcGhqMhmyCyJxjDIKgB0BMTIALxlyBRk2r4cOFAQYIJQUgHZtBzJyCGZ2cC5BUUoZSUVvNXZHPWNzYYJHO1+gV2hWdRAA
Related Issues: