Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add check for delete expression must be optional#37921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weswigham merged 2 commits intomicrosoft:masterfromKingwl:delete_optional
Apr 22, 2020

Conversation

Kingwl
Copy link
Contributor

Fixes#13783

Ionaru, kkaefer, SlurpTheo, Exac, and styfle reacted with thumbs up emoji
@j-oliveras
Copy link
Contributor

Is needed a test with an index type? Like:

interfaceBar{[id:string]:string;}declareconsta:Bardeletea["a"];deletea.b;

@Kingwl
Copy link
ContributorAuthor

Kingwl commentedApr 13, 2020
edited
Loading

Is needed a test with an index type? Like:

Good point.

@typescript-bot pack this.

@Kingwl
Copy link
ContributorAuthor

Hey, How are you?@typescript-bot

@typescript-bot pack this.

@typescript-bot
Copy link
Collaborator

typescript-bot commentedApr 13, 2020
edited
Loading

Heya@Kingwl, I've started to run the tarball bundle task on this PR at6e4b381. You can monitor the buildhere.

@typescript-bot
Copy link
Collaborator

typescript-bot commentedApr 13, 2020
edited
Loading

Hey@Kingwl, I've packed this intoan installable tgz. You can install it for testing by referencing it in yourpackage.json like so:

{    "devDependencies": {        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/71131/artifacts?artifactName=tgz&fileId=48169EB321B4086E6AE66D6A286AB7E7D6AA2CCF9BF40D7869FAD1ED36C17C9602&fileName=/typescript-3.9.0-insiders.20200413.tgz"    }}

and then runningnpm install.


There is also a playgroundfor this build.

@sandersnsandersn added the For Uncommitted BugPR for untriaged, rejected, closed or missing bug labelApr 21, 2020
@DanielRosenwasser
Copy link
Member

DanielRosenwasser commentedApr 24, 2020
edited
Loading

This is a breaking change that was added in post beta with no test run on it. I think we should have had more due diligence before pulling it in. I think we should back it out and add it in for 4.0.

@simhnna
Copy link

What's the reasoning behind excludingnull from this list?

the operand must now be any, unknown, never, or be optional (in that it contains undefined in the type)

@DanielRosenwasser
Copy link
Member

Becausedelete doesn't leave behind anull.

@rohitf
Copy link

rohitf commentedSep 17, 2020
edited
Loading

Seeing a possible bug for the following case -even though TS recognizes thatkey in delete p[key] can be either 'foo' or 'bar', it does not error.

interface Props {    foo: string;    bar: string;}const p: Props = {    foo: 'hello',    bar: 'world'}const keys = ['foo', 'bar'] as const;keys.forEach(key => delete p[key]) // Should error since foo and bar are required props

Playground Link

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@weswighamweswighamweswigham approved these changes

@elibarzilayelibarzilayAwaiting requested review from elibarzilay

Assignees

@elibarzilayelibarzilay

Labels
For Uncommitted BugPR for untriaged, rejected, closed or missing bug
Projects
Archived in project
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

deleting a prop doesn't invalidate the interface
9 participants
@Kingwl@j-oliveras@typescript-bot@DanielRosenwasser@simhnna@rohitf@weswigham@elibarzilay@sandersn

[8]ページ先頭

©2009-2025 Movatter.jp