in src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs [1623:1793]
public Diagnostic UserDefinedTypesNotAllowedInFunctionDeclaration() => CoreError(
"BCP342",
$"""User-defined types are not supported in user-defined function parameters or outputs.""");
public Diagnostic ExpectedAssertIdentifier() => CoreError(
"BCP344",
"Expected an assert identifier at this location.");
public Diagnostic TestDeclarationMustReferenceBicepTest() => CoreError(
"BCP345",
"A test declaration can only reference a Bicep File");
public Diagnostic ExpectedTestIdentifier() => CoreError(
"BCP346",
"Expected a test identifier at this location.");
public Diagnostic ExpectedTestPathString() => CoreError(
"BCP347",
"Expected a test path string at this location.");
public Diagnostic TestDeclarationStatementsUnsupported() => CoreError(
"BCP348",
$@"Using a test declaration statement requires enabling EXPERIMENTAL feature ""{nameof(ExperimentalFeaturesEnabled.TestFramework)}"".");
public Diagnostic AssertsUnsupported() => CoreError(
"BCP349",
$@"Using an assert declaration requires enabling EXPERIMENTAL feature ""{nameof(ExperimentalFeaturesEnabled.Assertions)}"".");
public Diagnostic InvalidAssertAssignment(TypeSymbol valueType) => CoreError(
"BCP350",
$"Value of type \"{valueType}\" cannot be assigned to an assert. Asserts can take values of type 'bool' only.");
public Diagnostic FunctionOnlyValidWithDirectAssignment(string functionName) => CoreError(
"BCP351",
$"Function \"{functionName}\" is not valid at this location. It can only be used when directly assigning to a parameter.");
public Diagnostic FailedToEvaluateVariable(string name, string message) => CoreError(
"BCP352",
$"Failed to evaluate variable \"{name}\": {message}");
public Diagnostic ItemsMustBeCaseInsensitivelyUnique(string itemTypePluralName, IEnumerable<string> itemNames) => CoreError(
"BCP353",
$"The {itemTypePluralName} {ToQuotedString(itemNames)} differ only in casing. The ARM deployments engine is not case sensitive and will not be able to distinguish between them.");
public Diagnostic ExpectedSymbolListOrWildcard() => CoreError(
"BCP354",
"Expected left brace ('{') or asterisk ('*') character at this location.");
public Diagnostic ExpectedExportedSymbolName() => CoreError(
"BCP355",
"Expected the name of an exported symbol at this location.");
public Diagnostic ExpectedNamespaceIdentifier() => CoreError(
"BCP356",
"Expected a valid namespace identifier at this location.");
public Diagnostic PathHasNotBeenSpecified() => CoreError(
"BCP358",
"This declaration is missing a template file path reference.");
public Diagnostic ImportedSymbolNotFound(string symbolName) => CoreError(
"BCP360",
$"The '{symbolName}' symbol was not found in (or was not exported by) the imported template.");
public Diagnostic ExportDecoratorMustTargetStatement() => CoreError(
"BCP361",
@"The ""@export()"" decorator must target a top-level statement.");
public Diagnostic SymbolImportedMultipleTimes(params string[] importedAs) => CoreError(
"BCP362",
$"This symbol is imported multiple times under the names {string.Join(", ", importedAs.Select(identifier => $"'{identifier}'"))}.");
public Diagnostic DiscriminatorDecoratorOnlySupportedForObjectUnions() => CoreError(
"BCP363",
$"The \"{LanguageConstants.TypeDiscriminatorDecoratorName}\" decorator can only be applied to object-only union types with unique member types.");
public Diagnostic DiscriminatorPropertyMustBeRequiredStringLiteral(string discriminatorPropertyName) => CoreError(
"BCP364",
$"The property \"{discriminatorPropertyName}\" must be a required string literal on all union member types.");
public Diagnostic DiscriminatorPropertyMemberDuplicatedValue(string discriminatorPropertyName, string discriminatorPropertyValue) => CoreError(
"BCP365",
$"The value \"{discriminatorPropertyValue}\" for discriminator property \"{discriminatorPropertyName}\" is duplicated across multiple union member types. The value must be unique across all union member types.");
public Diagnostic DiscriminatorPropertyNameMustMatch(string acceptablePropertyName) => CoreError(
"BCP366",
$"The discriminator property name must be \"{acceptablePropertyName}\" on all union member types.");
public Diagnostic FeatureIsTemporarilyDisabled(string featureName) => CoreError(
"BCP367",
$"The \"{featureName}\" feature is temporarily disabled.");
public Diagnostic ParameterReferencesKeyVaultSuppliedParameter(string targetName) => CoreError(
"BCP368",
$"The value of the \"{targetName}\" parameter cannot be known until the template deployment has started because it uses a reference to a secret value in Azure Key Vault. Expressions that refer to the \"{targetName}\" parameter may be used in {LanguageConstants.LanguageFileExtension} files but not in {LanguageConstants.ParamsFileExtension} files.");
public Diagnostic ParameterReferencesDefaultedParameter(string targetName) => CoreError(
"BCP369",
$"The value of the \"{targetName}\" parameter cannot be known until the template deployment has started because it uses the default value defined in the template. Expressions that refer to the \"{targetName}\" parameter may be used in {LanguageConstants.LanguageFileExtension} files but not in {LanguageConstants.ParamsFileExtension} files.");
public Diagnostic ClosureContainsNonExportableSymbols(IEnumerable<string> nonExportableSymbols) => CoreError(
"BCP372",
@$"The ""@export()"" decorator may not be applied to variables that refer to parameters, modules, or resource, either directly or indirectly. The target of this decorator contains direct or transitive references to the following unexportable symbols: {ToQuotedString(nonExportableSymbols)}.");
public Diagnostic ImportedSymbolHasErrors(string name, string message) => CoreError(
"BCP373",
$"Unable to import the symbol named \"{name}\": {message}");
public Diagnostic ImportedModelContainsAmbiguousExports(IEnumerable<string> ambiguousExportNames) => CoreError(
"BCP374",
$"The imported model cannot be loaded with a wildcard because it contains the following duplicated exports: {ToQuotedString(ambiguousExportNames)}.");
public Diagnostic ImportListItemDoesNotIncludeDeclaredSymbolName() => CoreError(
"BCP375",
"An import list item that identifies its target with a quoted string must include an 'as <alias>' clause.");
public Diagnostic ImportedSymbolKindNotSupportedInSourceFileKind(string name, ExportMetadataKind exportMetadataKind, BicepSourceFileKind sourceFileKind) => CoreError(
"BCP376",
$"The \"{name}\" symbol cannot be imported because imports of kind {exportMetadataKind} are not supported in files of kind {sourceFileKind}.");
public Diagnostic InvalidExtensionAliasName(string aliasName) => CoreError(
"BCP377",
$"The extension alias name \"{aliasName}\" is invalid. Valid characters are alphanumeric, \"_\", or \"-\".");
public Diagnostic InvalidOciArtifactExtensionAliasRegistryNullOrUndefined(string aliasName, IOUri? configFileUri) => CoreError(
"BCP378",
$"The OCI artifact extension alias \"{aliasName}\" in the {BuildBicepConfigurationClause(configFileUri)} is invalid. The \"registry\" property cannot be null or undefined.");
public Diagnostic OciArtifactExtensionAliasNameDoesNotExistInConfiguration(string aliasName, IOUri? configFileUri) => CoreError(
"BCP379",
$"The OCI artifact extension alias name \"{aliasName}\" does not exist in the {BuildBicepConfigurationClause(configFileUri)}.");
public Diagnostic UnsupportedArtifactType(ArtifactType artifactType) => CoreError(
"BCP380",
$"Artifacts of type: \"{artifactType}\" are not supported."
);
public Diagnostic TypeIsNotParameterizable(string typeName) => CoreError(
"BCP383",
$"The \"{typeName}\" type is not parameterizable.");
public Diagnostic TypeRequiresParameterization(string typeName, int requiredArgumentCount) => CoreError(
"BCP384",
$"The \"{typeName}\" type requires {requiredArgumentCount} argument(s).");
public Diagnostic DecoratorMayNotTargetResourceDerivedType(string decoratorName) => CoreError(
"BCP386",
$@"The decorator ""{decoratorName}"" may not be used on statements whose declared type is a reference to a resource-derived type.");
public Diagnostic NegatedTypeIndexSought() => CoreError(
"BCP387",
"Indexing into a type requires an integer greater than or equal to 0.");
public Diagnostic TupleRequiredForIndexAccess(TypeSymbol wrongType) => CoreError(
"BCP388",
$"Cannot access elements of type \"{wrongType}\" by index. An tuple type is required.");
public Diagnostic ExplicitAdditionalPropertiesTypeRequiredForAccessThereto(TypeSymbol wrongType) => CoreError(
"BCP389",
$"The type \"{wrongType}\" does not declare an additional properties type.");
public Diagnostic ExplicitItemsTypeRequiredForAccessThereto() => CoreError(
"BCP390",
$"The array item type access operator ('[*]') can only be used with typed arrays.");
public Diagnostic AccessExpressionForbiddenBase() => CoreError(
"BCP391",
"Type member access is only supported on a reference to a named type.");
public Diagnostic InvalidResourceTypeIdentifier(string resourceTypeIdentifier) => CoreWarning(
"BCP392",
$"""The supplied resource type identifier "{resourceTypeIdentifier}" was not recognized as a valid resource type name.""");