Search Issue Tracker
Fixed in 2022.1.X
Fixed in 2021.2.X
Votes
1
Found in
2021.2.0b6
2022.1
Issue ID
1355846
Regression
No
System.Memory ReadOnlySpan() method is not supported and throws an error when used
Reproduction steps:
1. Open the user's attached project
2. Observer the Console
Expected result: The are no errors in the Console
Actual result: There is an error in the Console
Reproducible with: 2021.2.0b6, 2022.1.0a5
Not reproducible with: 2020.3.16f1, 2021.1.17f1, 2021.2.0b5
could not test with: 2019.4.29f1 (downgraded project throws error)
Note:
-The error is: Assets\SpanTest.cs(26,29): error CS0570: 'ReadOnlySpan<T>.this[int].get' is not supported by the language
-
SugoiDev
Aug 23, 2021 14:11
Related forum thread: https://forum.unity.com/threads/2021-2-0b6-and-system-memory-readonlyspan-under-net-4-8.1152104/
Also missing: pinning spans. So this also doesn't work
private static unsafe void SpanInFixedContext(ReadOnlySpan<byte> s) {
fixed (byte* dest = s) {
//do something
}
}Previously, we would be able to add System.Memory.dll manually, but doing so now will cause conflicts since mscorlib already includes it (even if partially).
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Inconsistent behaviour when interacting with different dropdown types with pointer events on parent Visual Element
- Hidden GameObjects won't re-enable when they have call "DontDestroyOnLoad" function
- Overlay Canvas are rendered on each split-screen camera when HDR is enabled
- [Android] The Player loses focus when using UnityEngine.Handheld.StartActivityIndicator() with Facebook SDK
- Build fails with "Building Library/Bee/artifacts/MacStandalonePlayerBuildProgram/gahcy/hj9mx3z/951.0 failed with output:..." errors when Scripting Backend is set to IL2CPP
Resolution Note (fix version 2022.1):
Fixed in 2022.1.0a7
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0b11