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
- GPU utilization increases by 20% on Meta Quest headsets when Render Graph is enabled on 6000.0.16f1 and higher
- Value on Slider (Int) control in UI Builder displays as default when saving UI Document
- Color mismatch in UI Builders Library panel when the Editors theme is set to Light Mode
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
- Non-HDR color picker opens when selecting material color with HDR enabled
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