Repository: shader-slang/slang
File: source/slang/slang-diagnostic-defs.h (C/C++)

Code before:

DIAGNOSTIC(
    41030,
    Warning,
    operatorShiftLeftOverflow,
    "left shift amount exceeds the number of bits and the result will be always zero, (`$0` << "
    "`$1`).")

DIAGNOSTIC(
    41901,
    Error,
    unsupportedUseOfLValueForAutoDiff,
    "unsupported use of L-value for auto differentiation.")
DIAGNOSTIC(
    41902,
    Error,
    cannotDifferentiateDynamicallyIndexedData,
    "cannot auto-differentiate mixed read/write access to dynamically indexed data in '$0'.")

DIAGNOSTIC(41903, Error, unableToSizeOf, "sizeof could not be performed for type '$0'.")
DIAGNOSTIC(41904, Error, unableToAlignOf, "alignof could not be performed for type '$0'.")

DIAGNOSTIC(
    42001,
    Error,
    invalidUseOfTorchTensorTypeInDeviceFunc,
    "invalid use of TorchTensor type in device/kernel functions. use `TensorView` instead.")

DIAGNOSTIC(
    42050,
    Warning,
    potentialIssuesWithPreferRecomputeOnSideEffectMethod,
    "$0 has [PreferRecompute] and may have side effects. side effects may execute multiple times. "
    "use [PreferRecompute(SideEffectBehavior.Allow)], or mark function with [__NoSideEffect]")

DIAGNOSTIC(45001, Error, unresolvedSymbol, "unresolved external symbol '$0'.")

DIAGNOSTIC(
    41201,
    Warning,
    expectDynamicUniformArgument,
    "argument for '$0' might not be a dynamic uniform, use `asDynamicUniform()` to silence this "
    "warning.")
DIAGNOSTIC(
    41201,
    Warning,
    expectDynamicUniformValue,
    "value stored at this location must be dynamic uniform, use `asDynamicUniform()` to silence "
    "this warning.")



Review comment (suggestion):
40006 is conflict with the `unimplementedSystemValueSemantic` error code above, so I renamed it to 40012 below.

Code after:
    Error,
    bindingAlreadyOccupiedByComponent,
    "resource binding location '$0' is already occupied by component '$1'.")
DIAGNOSTIC(40002, Error, invalidBindingValue, "binding location '$0' is out of valid range.")
DIAGNOSTIC(
    40003,
    Error,
    bindingExceedsLimit,
    "binding location '$0' assigned to component '$1' exceeds maximum limit.")
DIAGNOSTIC(
    40004,
    Error,
    bindingAlreadyOccupiedByModule,
    "DescriptorSet ID '$0' is already occupied by module instance '$1'.")
DIAGNOSTIC(
    40005,
    Error,
    topLevelModuleUsedWithoutSpecifyingBinding,
    "top level module '$0' is being used without specifying binding location. Use [Binding: "
    "\"index\"] attribute to provide a binding location.")
DIAGNOSTIC(40006, Error, unimplementedSystemValueSemantic, "unknown system-value semantic '$0'")

DIAGNOSTIC(49999, Error, unknownSystemValueSemantic, "unknown system-value semantic '$0'")

DIAGNOSTIC(40007, Internal, irValidationFailed, "IR validation failed: $0")

DIAGNOSTIC(
    40008,
    Error,
    invalidLValueForRefParameter,
    "the form of this l-value argument is not valid for a `ref` parameter")

DIAGNOSTIC(
    40009,
    Error,
    dynamicInterfaceLacksAnyValueSizeAttribute,
    "interface '$0' is being used in dynamic dispatch code but has no [anyValueSize] attribute "
    "defined.")
DIAGNOSTIC(40010, Note, seeInterfaceUsage, "see usage of interface '$0'.")

DIAGNOSTIC(
    40011,
    Error,
    unconstrainedGenericParameterNotAllowedInDynamicFunction,
    "unconstrained generic paramter '$0' is not allowed in a dynamic function.")

DIAGNOSTIC(40012, Error, needCompileTimeConstant, "expected a compile-time constant")

DIAGNOSTIC(40013, Error, argIsNotConstexpr, "arg $0 in '$1' is not a compile-time constant")

DIAGNOSTIC(