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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow method and property invocations of signatures containing pointer types #15767
Comments
We would need something like |
Nah nothing like that is needed. This isn't about supporting things like I went ahead and changed the example to not confuse the issue, this isn't really any different than what you can already do with |
nice hack ! |
Thanks! Note that it's not really a hack. I mean it is, but this is also how the reflection API's in general handle pointers. The engine just doesn't account for them. |
Obviously, it was hack in the noble sense of the term 🙂 |
The Engine WG discussed this and agree it would be good to enable these scenarios under an experimental feature if it is easy to do so. I'm going to leave up for grabs off of this one because the benefit to complexity ratio is very delicate here. Some effort should be taken to introduce the least amount of maintenance requirements that still enables this scenario. |
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
2 similar comments
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes. |
Summary of the new feature / enhancement
As someone who writes in C#, I want to be able to use PowerShell to prototype as much as possible. Currently, this comes to a grinding halt whenever a pointer (
void*
orT*
) is involved. It is not possible to enable this outside of the engine with custom type conversions, but it is possible from within the engine itself.Proposed technical implementation details (optional)
Binder support
On a whim I gave adding support for "boxing"
void*
toSystem.Reflection.Pointer
to see if it were feasible. Turns out with just 9 additional lines, the engine can get very minimal support:After this, the following works:
Now the above diff isn't exactly the best way to go about it, but it shows that adding support to the binder is now pretty easy with CAS gone.
PSPointer API Proposal (click to expand)
There are a lot more hurdles to getting approval for a public API like this then just lighting up support in the binder, so this is more of a "stretch goal".
Why
System.Reflection.Pointer
is by design pretty bare. Pretty much all you can do with it is unbox it, which makes sense, but makes it less desirable for the use case of prototyping.API
The text was updated successfully, but these errors were encountered: