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

Decode string booleans #277

Merged
merged 2 commits into from
Jun 11, 2019
Merged

Decode string booleans #277

merged 2 commits into from
Jun 11, 2019

Conversation

langmartin
Copy link
Contributor

When we're decoding into a string value, convert the other literal types (FLOAT and BOOL) to strings as well. Previously, decoding would fail on an unexpected literal type.

Copy link
Member

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that there was already a case for token.NUMBER here suggests that the original intent was for the decoder to do automatic conversions from other primitive types to string, so this seems reasonable to me.

The results here are also consistent with the automatic conversions from numbers and bools to string in HCL 2, so the same input would produce an equivalent result in HCL 2.

@langmartin langmartin merged commit cf7d376 into master Jun 11, 2019
@mitchellh mitchellh deleted the decode-string-booleans branch October 22, 2020 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants