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 is cropped/positioned incorrectly when more than one display is used and a higher display Scale is set
- Opening a dropdown on a small screen results in its instant closing when mouse cursor is pressed where the dropdown is going to be opened
- Only "ArgumentNullException: Value cannot be null" is displayed instead of all the actual errors when opening a project with numerous compilation errors
- MultiColumnListView and MultiColumnTreeView do not change selection on first input when focus is set by code
- SerializedProperty.DataEquals is returning false when SerializedProperty.EqualContents return true
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