Copyright © 2026 Unity Technologies
Description:
UAL0010/UAL0013 instruct you to add an AutoStaticsCleanup or NoAutoStaticsCleanup attribute. Doing exactly that turns the warning into a hard CS0260 error, because the attribute drives a source generator that emits a partial declaration - so the type must also be declared partial, which the warning never mentions. The required namespace is not mentioned either.
Steps to reproduce:
public static class Probe { public static float Value { get; set; } }
using Unity.Scripting.LifecycleManagement;
[AutoStaticsCleanup]
public static class Probe
{
public static float Value { get; set; }
}
Actual results: At checkpoint 1 - both rules fire on the same four-line type, one on the declaration and one on the property:
Assets/Probe.cs(1,21): warning UAL0010: A type with static fields, automatic properties or events must have an AutoStaticsCleanup or NoAutoStaticsCleanup attribute. Static members: Value. Assets/Probe.cs(3,25): warning UAL0013: A type with static fields, automatic properties or events must have an AutoStaticsCleanup or NoAutoStaticsCleanup attribute.
At checkpoint 2:
error CS0260: Missing partial modifier on declaration of type 'Probe'; another partial declaration of this type exists
Expected results: The warning names all three requirements - the attribute, the partial modifier, and the Unity.Scripting.LifecycleManagement namespace. None of the three appear in the message; the namespace had to be found by grepping installed Unity source.
Reproducible with versions: 6000.7.0a5
Not reproducible with versions: 6000.6.0b8, 6000.5.7f1, 6000.3.23f1, 6000.0.80f1
Tested on (OS): MacBook Pro - Tahoe 26.6.1
Issues you vote on will appear here