当为函数提供具有错误数据类型的参数时,会发生此诊断。
说明
<参数类型> 的参数不能分配给 <参数类型>类型的参数。
级别
错误
解决方案
提供具有正确数据类型的参数。
例子
下面的示例引发诊断,因为当字符串用作第一个参数时,contains()
函数需要字符串作为第二个参数,但提供了整数:
output stringTrue bool = contains('OneTwoThree', 2)
可以使用字符串作为第二个参数来修复诊断:
output stringTrue bool = contains('OneTwoThree', 'Two')
后续步骤
有关 Bicep 诊断的详细信息,请参阅 Bicep 核心诊断。