Skip to content
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

Misleading error message when attempting to declare a single-line array #1444

Closed
majastrz opened this issue Feb 3, 2021 · 4 comments
Closed
Milestone

Comments

@majastrz
Copy link
Member

majastrz commented Feb 3, 2021

Bicep version
0.2.328 (last released as of right now)

Describe the bug
When you follow the below repro steps, you get the BCP018 error with message: Expected the "]" character at this location.

The error is misleading because the real issue is that the array wasn't spread across multiple lines (newlines are basically missing).

To Reproduce
Paste in the following bicep snippet into VS code:

var things = [true]

Additional context
image

@ghost ghost added the Needs: Triage 🔍 label Feb 3, 2021
@alex-frankel alex-frankel added this to the v0.4 milestone Feb 10, 2021
@miqm
Copy link
Collaborator

miqm commented Mar 15, 2021

Wouldn't this be gone after #586 will be implemented?

@alex-frankel
Copy link
Collaborator

Yes it would

@StephenWeatherford
Copy link
Contributor

Another example:

param password string = 'xxxx'
param o object = { a: 1 }
var sum = 1 + 3
output sub int = sum

Actual error:
image
Expected: error on the param o object line

@anthony-c-martin
Copy link
Member

Closed with #4956

@ghost ghost locked as resolved and limited conversation to collaborators May 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants