Skip to content

Conversation

@SeeminglyScience
Copy link
Collaborator

@SeeminglyScience SeeminglyScience commented Oct 13, 2018

PR Summary

Added handling for PSMethod objects in TryGetTypeFromMember. This fixes type inference for static method invocations (e.g. [powershell]::Create()).

Resolves #7820

I wasn't able to find any tests for member completion so I added a few as well along with the test case for the resolved issue.

PR Checklist

@SeeminglyScience
Copy link
Collaborator Author

Looking into test failures. Also will move tests to the type inference section that I missed. Moving to WIP

@SeeminglyScience SeeminglyScience changed the title Fix static method invocation type inference WIP: Fix static method invocation type inference Oct 13, 2018
@SeeminglyScience SeeminglyScience changed the title WIP: Fix static method invocation type inference Fix static method invocation type inference Oct 13, 2018
@SeeminglyScience
Copy link
Collaborator Author

Alright it's ready. I'm fairly certain that test failure isn't related, but if I'm wrong let me know and I'll look into it.

@iSazonov
Copy link
Collaborator

@SeeminglyScience Seems test failure is related to your change.

You could add a test from original Issue to TabCompletion.Tests.ps1

@SeeminglyScience
Copy link
Collaborator Author

Oh okay, I originally read the failure message backwards. It looks like the change catches an additional property that was previously missed. I'll change that test to include the missed property and a add test for the original example as well.

@iSazonov iSazonov requested a review from lzybkr October 16, 2018 03:14
@iSazonov iSazonov self-assigned this Oct 16, 2018
@iSazonov iSazonov merged commit 57bf508 into PowerShell:master Oct 23, 2018
@iSazonov
Copy link
Collaborator

@SeeminglyScience Thanks for your contribution!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type inference of static method invocations isn't working

3 participants