JetBrains Rider 2025.3 Help

Code inspection: Accessing managed indexers is not supported

This inspection detects attempts to use indexers (e.g., obj[index]) on managed objects (classes) within a method compiled with Unity's Burst compiler.

Burst is designed for high-performance code and only supports a subset of C# that is "blittable" and avoids managed objects and garbage collection. Since managed classes are stored on the heap and require garbage collection, they cannot be safely accessed inside Burst-compiled code.

How it works

The analyzer monitors all element access expression nodes (code like myList[0] or myDictionary["key"]) within a Burst-compiled context (e.g., a Job with the [BurstCompile] attribute).

It resolves the element access to its underlying property (the indexer) and checks the containing type. If the containing type is a class (managed type) and not a standard C# array (which has special handling in Burst), it triggers the warning.

Example

In this example, the managedList[0] access is flagged because List<T> is a managed class. Replacing it with a NativeArray<T> resolves the issue as it is a blittable struct.

using Unity.Burst; using Unity.Jobs; using System.Collections.Generic; [BurstCompile] public struct MyJob : IJob { public List<int> managedList; // Managed reference! public void Execute() { // Reported: Accessing a managed indexer from 'System.Collections.Generic.List<int>' is not supported int value = managedList[0]; } }
using Unity.Burst; using Unity.Jobs; using Unity.Collections; [BurstCompile] public struct MyJob : IJob { // Use Native containers instead of managed ones public NativeArray<int> nativeArray; public void Execute() { // Safe: NativeArray is a blittable struct and its indexer is supported by Burst int value = nativeArray[0]; } }
26 March 2026