-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
This is about #5287
-
DelegateArgsComparator.ParameterTypesMatchesdoesn't consider the Variance in delegate parameter types. A method signatureint CallMe(object input)should be able to be converted toFunc<string, int>. -
PSMethod.MatchesPSMethodProjectedTypedoesn't handle the case where bothtargetTypeandprojectedSourceTypeare the sameByReftype orPointertype. - I think the 'Unit' type name should be changed to 'VOID'. Use type
Unitto representvoidis not intuitive and I misread it touintwhen first looking at the code. - I don't get the point of having
ReplaceGenericTypeArgumentsWithMarkerTypes. After making a generic method using our synthetic reference/value types, the generatedMethodInfosignature won't match any real delegates except in one condition -- the original generic method doesn't use the generic type argument for any of its parameters or return type -- I think it's rare for this condition to be met for a generic method. - I agree that we need pseudo types to represent
ByReftype (ref/out),Pointertypevoidtype and evenTypeReference, but why do we needPSEnum<>to wrap enum types? RemovePSEnum<>and use the enum type directly. - Handle method signatures with
Span<T>orReadOnlySpan<T>as its parameter type or return type. They cannot be used as type argument, and therefore we cannot use them directly to construct a generic type ofFunc<>. In fact, this is a more general problem with all ref-like types, such aspublic ref struct Foo { private Span<int> _pointer }. It would be great if we can have a generic solution for all ref-like types, but at least we need to handleSpan<T>andReadOnlySpan<T>as they are getting more and more usage. See the discussion comments: Further improve PSMethod to Delegate conversion #6851 (comment)
Metadata
Metadata
Assignees
Labels
Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime