GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Missing property fix by aozgaa · Pull Request #14097 · microsoft/TypeScript

Conversation

@aozgaa

@aozgaa Arthur Ozga (aozgaa) commented Feb 15, 2017

Copy link
Copy Markdown
Contributor

Implements #13071.

Note that there is considerably more work to do for stubbing out missing methods if we want to do any type inference on the parameters. There are additionally issues with inferring type parameters for the stubbed method from its type arguments.

Thoughts Mohamed Hegazy (@mhegazy) Bill Ticehurst (@billti) Daniel Rosenwasser (@DanielRosenwasser) ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Arthur Ozga added 6 commits February 14, 2017 17:30
Arthur Ozga
wip
9897c69
Arthur Ozga
Get Widened Type
92e4c6b
Arthur Ozga
wip testing
f047a6e
Arthur Ozga
add tests
18cba86
Arthur Ozga
use getBaseTypeOfLiteralType
9110461
Arthur Ozga
cleanup
cf3b4d6
@msftclas Microsoft Contribution License Agreements (msftclas) added the cla-not-required label Feb 15, 2017
mhegazy
Mohamed Hegazy (mhegazy) reviewed Feb 16, 2017
View reviewed changes
Comment thread src/services/codefixes/fixAddMissingMember.ts Outdated
const binaryExpression = token.parent.parent as BinaryExpression;

const checker = context.program.getTypeChecker();
const widenedType = checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(binaryExpression.right));

@mhegazy Mohamed Hegazy (mhegazy) Feb 16, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you also want to widen it. i.e. null => any

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mhegazy
Mohamed Hegazy (mhegazy) approved these changes Feb 16, 2017
View reviewed changes

@mhegazy Mohamed Hegazy (mhegazy) left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. just add the getWidenedType call

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) requested changes Feb 16, 2017
View reviewed changes
Comment thread src/services/codefixes/fixAddMissingMember.ts Outdated
}]
},
{
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Add_index_accessor_for_missing_property_0), [token.getText()]),

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Feb 16, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. "index accessor" -> "index signature"
  2. You either need a test for this fix, or you should get rid of it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@aozgaa Arthur Ozga (aozgaa) Feb 16, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed and test added

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Arthur Ozga added 2 commits February 16, 2017 13:37
Arthur Ozga
widen type, index signature, and add tests
1b6cf97
Arthur Ozga
Merge branch 'master' into MissingPropertyFix
6e198f9
mhegazy
Mohamed Hegazy (mhegazy) approved these changes Feb 16, 2017
View reviewed changes
@mhegazy

Mohamed Hegazy (mhegazy) commented Feb 16, 2017

Copy link
Copy Markdown
Contributor

Arthur Ozga (@aozgaa) after merging in master please port this to release-2.2

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aozgaa
Arthur Ozga (aozgaa) merged commit 8a5bebe into microsoft:master Feb 16, 2017
@aozgaa Arthur Ozga (aozgaa) mentioned this pull request Feb 16, 2017
Missing property fix 2.2 #14133
Merged
@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) mentioned this pull request Feb 17, 2017
Code Action to create functions or properties #12462
Closed
@aozgaa
Arthur Ozga (aozgaa) deleted the MissingPropertyFix branch June 6, 2017 17:56
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) DanielRosenwasser requested changes
+1 more reviewer
@mhegazy Mohamed Hegazy (mhegazy) mhegazy approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@aozgaa @mhegazy @DanielRosenwasser @msftclas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.