Diagnostic codes

Concordance reports mistakes in your code editor as you type, and in the Console window when Unity compiles. CND00xx codes are errors, CND01xx warnings, and CND02xx hints shown in your code editor only.

Errors

CND0001: (Modifier) must apply to the whole right side

(Modifier)x * 0.5f applies only to x. Write (Modifier)(x * 0.5f). Your code editor offers this fix.

CND0002: (Modifier) must start the right side of an assignment to a field or property

A modifier belongs to the member it's assigned to, so (Modifier) in a method argument, a local or a return value has none. Assign it to the member, or pass it as the value of a getter and setter pair's setter.

CND0003: A modifier cannot be assigned here

A chained assignment, a deconstruction, ??=, a local or a parameter has no single member. Write one assignment to the member, in its own statement.

CND0004: Modifier.Stop cannot be used with a compound assignment

Write x = Modifier.Stop.

CND0005: A modifier function cannot follow (Modifier)

Pass the modifier function to Modify: x.Modify(function).

CND0006: (Modifier) cannot take a value of a generic type parameter

Use the regular syntax: x.Modify(value).

CND0007: (Modifier) cannot appear twice in one value

Split the line in two.

CND0009: The receiver must be a field or a property that can be written

Call Modify, Observe and the other methods on the member itself: a field, a property with a setter, or the getter of a getter and setter pair. Never call them on a local variable.

CND0010: A struct in a local or a parameter cannot take modifiers

A struct in a local variable or a parameter is a copy, with no member to hold the modifier. Modify the field or property that holds the struct instead, as in offset.x = (Modifier)0f or transform.position.y.Modify(0f).

CND0011: A modifier line in a struct method has no owner

Use the regular syntax with an owner: x.Modify(value, owner: manager).

CND0012: The member cannot take modifiers

The engine computes this member from its own previous value. Modify what the message names instead. For more information, refer to Members the engine updates.

CND0014: GetUnmodified cannot read the member a modifier line writes

Read the base value into a local variable before the line.

CND0016: (Modifier) cannot take a type private to a class

Make the type internal, or use the regular syntax: x.Modify(...).

CND0018: An array element, an indexer or a method taking more than the value is not a member

Give the value a field, or wrap it in a property of your own and modify the property. For more information, refer to Wrap a value in a property.

Warnings

CND0101: A static modifier is never stopped

A modifier written in a static method lasts until you exit Play mode. Stop it, or pass an object as its owner.

CND0104: ModifierInfo.Key is compared by reference

Compare keys with Equals.

CND0105: The special case names no type this assembly can see

Check the type's name and assembly, as in "UnityEngine.Cloth, UnityEngine.ClothModule", or use typeof.

CND0106: The getter and setter pair is not a member

A pair's setter takes the value as its only parameter, and its getter takes none. Wrap methods that take a key in a property of your own, as described in Wrap a value in a property.

CND0107: A modifier function field needs [SerializeReference]

Unity never saves a [SerializeField] field of a ModifierFunction<T> type. Mark it [SerializeReference]. Your code editor offers this fix.

CND0108: The name binds to another type than Concordance's

Another type named Modifier or ModifierPhase hides Concordance's. Rename your type, or add an alias inside your file's namespace:

namespace Gameplay
{
    using Modifier = Concordance.Modifier;
}

Hints

CND0201: The written member read through another receiver is a snapshot

Only the member itself reads as the value before the modifier. Read it through the same variable you assign. For more information, refer to The value before the modifier.

Additional resources