Edit

Share via


Bicep diagnostic code - BCP414

This diagnostic occurs when the reverse index operator (^) is used on an expression of an unsupported type, such as object, bool, or int.

Description

The ^ indexing operator can't be used on base expressions of type <data-type>.

Level

Error

Examples

The following code attempts to use the ^ operator on an object, which triggers BCP414.

var config = {
  name: 'example'
  value: 42
}

output result any = config[^1] // Error: BCP414 - The "^" indexing operator cannot be used on base expressions of type "object".

Object properties aren't ordered, so they can't be accessed in reverse. The ^ operator also isn't supported when accessing properties with square bracket notation.

var config = { 
  'property name': 'example'
  value: 42
}

output result string = config['property name']

Next steps

For more information about Bicep diagnostics, see Bicep core diagnostics.