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
- Prefab Override popup displays on wrong monitor when Inspector width is resized to minimum
- Scroll View is not moving by inertia after scrolling by click and dragging when Editor window is minimized and Canvas "Render Mode" is set to "World Space"
- "type mismatch error" occurs when the currentDirectionWS output of a Sample Water Surface node is connected to a float3 input
- URP Material Upgrade utility does not enable Alpha Clipping when material had Rendering Mode set to Cutout
- Particle System emission ignores the Sprite Atlas when using a Material that has the "Include in Build" setting unchecked
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