Search Issue Tracker
Fixed
Fixed in 1.8.17
Votes
0
Found in [Package]
1.8.10
1.8.13
1.8.16
Issue ID
BUR-2718
Regression
No
"Burst error BC1042: The managed class type `System.IntPtr` is not supported" error is thrown when calling OverlapSphereCommand.ScheduleBatch
Reproduction steps:
1. Open the “ReproProject“ project
2. Observe the Console window
Expected result: No errors are thrown in the Console window
Actual result: “(0,0): Burst error BC1042: The managed class type `System.IntPtr` is not supported.“ error is thrown in the Console window
Reproducible with: 1.8.10, 1.8.13, 1.8.16 (2022.3.35f1, 6000.0.8f1)
Reproducible on: Windows 11 Pro (22H2)
Not reproducible on: No other environment tested
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
- "Errors during XML parse" warnings are thrown when building project for the Android platform
- Shader transparency, discard, and clip are not working when using the Player
- Error is thrown when clicking on warning in the console
- Long IL2CPP build time when project has a .ufbx library wrapper
- Cursor doesn't change to the resizing when using the Rect Tool and the Sprite is too close to the bottom of the Scene View
Resolution Note (fix version 1.8.17):
The code in the repro project calls {{OverlapSphereCommand.ScheduleBatch}}, which contains some code that is incompatible with Burst. Specifically, there is code that loads from a non-readonly static field. That's why Burst emits a compilation error... however, the specific compilation error emitted was incorrect.
The error was:
Burst error BC1042: The managed class type `System.IntPtr` is not supported. Loading from a non-readonly static field `Unity.Jobs.LowLevel.Unsafe.BatchQueryJobStruct`1<Unity.Jobs.LowLevel.Unsafe.BatchQueryJob`2<UnityEngine.OverlapSphereCommand,UnityEngine.ColliderHit>>.jobReflectionData` is not supported
The first part is incorrect (managed class type...). The second part is the "correct" error message (non-readonly static field is not supported). So we've improved the error message to be more correct and less misleading. It's now:
Burst error BC1040: Loading from a non-readonly static field `Unity.Jobs.LowLevel.Unsafe.BatchQueryJobStruct`1<Unity.Jobs.LowLevel.Unsafe.BatchQueryJob`2<UnityEngine.OverlapSphereCommand,UnityEngine.ColliderHit>>.jobReflectionData` is not supported