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
Bicep version
run bicep --version via the Bicep CLI, az bicep version via the AZ CLI or via VS code by navigating to the extensions tab and searching for Bicep
Describe the bug
When indexing into an object with a string property, type checking doesn't seem to be fully done. In the below repo steps, foo the indexer should allow values of type 'One' | 'Two', and Input is of type 'Three' | 'Four'. There is no way that foo[Input] could ever succeed, so I'd expect the following code to result in a compiler error as there's no way this could result in anything other than a failure
Additional context
A more interesting variant is when there is the types partially match. (e.g. what if Input was of type 'Two' | 'Three' | 'Four'.) should this continue to be an error, or should it be a warning instead?
The text was updated successfully, but these errors were encountered:
Bicep version
run
bicep --version
via the Bicep CLI,az bicep version
via the AZ CLI or via VS code by navigating to the extensions tab and searching for BicepDescribe the bug
When indexing into an object with a string property, type checking doesn't seem to be fully done. In the below repo steps,
foo
the indexer should allow values of type'One' | 'Two'
, andInput
is of type'Three' | 'Four'
. There is no way thatfoo[Input]
could ever succeed, so I'd expect the following code to result in a compiler error as there's no way this could result in anything other than a failureTo Reproduce
Additional context
A more interesting variant is when there is the types partially match. (e.g. what if
Input
was of type'Two' | 'Three' | 'Four'
.) should this continue to be an error, or should it be a warning instead?The text was updated successfully, but these errors were encountered: