You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,7 +54,7 @@ If you need more information about a particular diagnostic code, select the **Fe
54
54
| <aid='BCP045' />BCP045 | Error | Can't apply operator "{operatorName}" to operands of type "{type1}" and "{type2}".{(additionalInfo is null? string.Empty : " " + additionalInfo)} |
55
55
| <aid='BCP046' />BCP046 | Error | Expected a value of type "{type}". |
56
56
| <aid='BCP047' />BCP047 | Error | String interpolation is unsupported for specifying the resource type. |
57
-
| <aid='BCP048' />BCP048 | Error | Can't resolve function overload. For details, see the documentation. |
57
+
| <aid='BCP048' />[BCP048](./diagnostics/bcp048.md)| Error | Can't resolve function overload.|
58
58
| <aid='BCP049' />BCP049 | Error | The array index must be of type "{LanguageConstants.String}" or "{LanguageConstants.Int}" but the provided index was of type "{wrongType}". |
59
59
| <aid='BCP050' />BCP050 | Error | The specified path is empty. |
60
60
| <aid='BCP051' />BCP051 | Error | The specified path begins with "/". Files must be referenced using relative paths. |
@@ -75,7 +75,7 @@ If you need more information about a particular diagnostic code, select the **Fe
75
75
| <aid='BCP067' />BCP067 | Error | Can't call functions on type "{wrongType}". An "{LanguageConstants.Object}" type is required. |
76
76
| <aid='BCP068' />BCP068 | Error | Expected a resource type string. Specify a valid resource type of format "\<types>@\<apiVersion>". |
77
77
| <aid='BCP069' />BCP069 | Error | The function "{function}" isn't supported. Use the "{@operator}" operator instead. |
78
-
| <aid='BCP070' />BCP070 | Error | Argument of type "{argumentType}" isn't assignable to parameter of type "{parameterType}". |
78
+
| <aid='BCP070' />[BCP070](./diagnostics/bcp070.md)| Error | Argument of type \<argument-type> isn't assignable to parameter of type \<parameter-type>. |
| <aid='BCP072' />[BCP072](./diagnostics/bcp072.md)| Error | This symbol can't be referenced here. Only other parameters can be referenced in parameter default values. |
81
81
| <aid='BCP073' />[BCP073](./diagnostics/bcp073.md)| Error/Warning | The property \<property-name> is read-only. Expressions can't be assigned to read-only properties. |
This diagnostic occurs when a function has two or more possible signatures, but the input provided doesn't match any of them.
12
+
13
+
## Description
14
+
15
+
Can't resolve function overload.
16
+
17
+
## Level
18
+
19
+
Error
20
+
21
+
## Solution
22
+
23
+
Ensure that the argument passed to the function matches one of the expected types defined in its overload signatures.
24
+
25
+
## Examples
26
+
27
+
The following example raises the diagnostic because the [`length()`](../bicep-functions-string.md#contains) function requires its argument to be a string, an object, or an array.
28
+
29
+
```bicep
30
+
output stringLength int = length(3)
31
+
```
32
+
33
+
You can fix the issue by providing an argument that matches the required argument type:
34
+
35
+
```bicep
36
+
output stringLength int = length('three')
37
+
```
38
+
39
+
## Next steps
40
+
41
+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).
description: Argument of type <argument-type> isn't assignable to parameter of type <parameter-type>.
4
+
ms.topic: reference
5
+
ms.custom: devx-track-bicep
6
+
ms.date: 02/20/2025
7
+
---
8
+
9
+
# Bicep diagnostic code - BCP070
10
+
11
+
This diagnostic occurs when a function is given an argument with the wrong data type.
12
+
13
+
## Description
14
+
15
+
Argument of type \<argument-type> isn't assignable to parameter of type \<parameter-type>.
16
+
17
+
## Level
18
+
19
+
Error
20
+
21
+
## Solution
22
+
23
+
Provide a parameter with the correct data type.
24
+
25
+
## Examples
26
+
27
+
The following example raises the diagnostic because the [`contains()`](../bicep-functions-string.md#contains) function, when used with a string as its first argument, requires a string as its second argument, but an integer was provided instead:
0 commit comments