-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
How to adopt PolySharp to support sub arrays #104
Comments
What data type is your _words ? I actually had the exact same issue. Turns our this only works on Arrays and Spans, as those are know to the compiler. I tried it with List, which works in NET5+, but not NET48 with any of the Polyfill libs. Edit: Sorry, correction - I have been trying this with diverse packages as well. My tests:
I cannot say anything about the quality of the PolyShim package, which seems to be the only one where this works 🤔 Will also look more into this, but maybe this helps you :-) |
And one more update: Seem to work with this and the other package if you just add that missing method, I got that from the blog link I posted. You only need this class / method
|
Last update (for now). I modified the method a bit to be closer to the original from https://source.dot.net/#System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs. Not sure what the
|
@Sergio0694 @xilefius why not add this to the code base? ;) |
According to the documentation PolySharp supports "Index and Range (see indices and ranges)".
The sample of the referenced Microsoft site tries to create sub-arrays:
Unfortunately, this sample gets complaints:
I'm confused about the generic statement regarding PolySharp's support for "Index and Range". Do I miss something?
The text was updated successfully, but these errors were encountered: