-
Notifications
You must be signed in to change notification settings - Fork 772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using variables for zones in template results in type mismatch #449
Comments
Good catch. Just posting this here for future reference to have an example VM with zones: |
We're going to take care of this as part of our 0.3 release, as the fix is going to take us a bit more time to do right. In the meantime, we have an undocumented escape hatch that you can use called
Let us know if you have any questions. We will document any() as part of #585 |
Adding my comment from #1735 here: The way I'd like to see this work is for all non-required properties to be treated as nullable, and then treat the assigned type of the ternary expression as var myObj = {
// returns an error
required: null
// returns an error
alsoRequired: condition ? null : someValue
// is allowed
optional: null
// is allowed
alsoOptional: condition ? null : someValue
} |
Adding one case that I think it's related with this - using a conditional in a module scope: Following code:
results in error:
|
Great find! Would you mind creating a separate issue for this? |
I agree with @anthony-c-martin's idea here. That is the cleanest way to fix it. However, we have to decide how we present this to the users in the language server. The vast majority of properties in swaggers are not marked as required even though they are actually required to create the resource. Once we implement the idea in the type system, the types of non-required properties will appear as One option would be to simplify the rendering/presentation of any type of the form I'm inclined to just expose the problem so everything stays consistent and then deal with the swagger inaccuracies over time, but I'm curious what others think. |
Changing the type of all non-required properties to One option would be to have two types on every property: a "read" type and a "write" type and only modify the "write" type to include the For now we decided to make a simpler fix to simply relax some of the assignability checks when we have |
I am trying to do the following ARM in Bicep:
When I condense it down to the following:
I am greeted by the error message "The property 'zones' expected a value of type 'string[]' but the provided value is of type 'array | null'."
The text was updated successfully, but these errors were encountered: