GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — WIP: Member-type based type guards by weswigham · Pull Request #6062 · microsoft/TypeScript Conversation
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Document what a selector is.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think we could discuss some issues with string literals with widening semantics. If you'd like, I'll look into what a widening approach would look like based on our earlier conversation. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Daniel Rosenwasser (@DanielRosenwasser) I've looked at it - string literal types just have to be contextually typed. Mostly because (unlike predicate types) they can appear inside arrays and object literals... and in all those cases we want them to widen away... except when we don't because there's a type annotation on the thing the literal is getting assigned to. And thus the contextual type is born - informing the type of the RHS by the type defined on the LHS side. So, my real issue: I want to run |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Wesley Wigham (@weswigham) I think #6196 is the answer to your first TODO 😃 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Is this now fixed by #8010? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Nope. type Action = { type: "REQUEST" } | { type: "SUCCESS", data: string } | { type: "FAILURE", error: any } let action: Action; if (action.type === "REQUEST"){ let inside = action; // Still `Action` } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I probably need to rework this PR, #8010 heavily modified the type guard code. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a87adee to
0e30aa1
Compare
0e30aa1 to
6636b7b
Compare
There was an error while loading. Please reload this page.
|
I think I've mostly reconciled the work in this PR with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Daniel Rosenwasser (@DanielRosenwasser) There's a change to the compatibility relationship test baselines (which have this kind of comparison in them) - I'm not 100% sure what the desired behavior there is, do you want to look at it? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.