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

Change properties key in YAML.mapping to reduce chance of conflict #5352

Merged
merged 1 commit into from Jan 2, 2018

Conversation

Sija
Copy link
Contributor

@Sija Sija commented Dec 5, 2017

Followup to #5180.

@@ -216,7 +216,7 @@ module YAML

# This is a convenience method to allow invoking `YAML.mapping`
# with named arguments instead of with a hash/named-tuple literal.
macro mapping(**properties)
::YAML.mapping({{properties}})
macro mapping(**_properties_)
Copy link
Member

Choose a reason for hiding this comment

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

I'm pretty sure that changing these 2 lines is all that's needed. No idea why the other PR went that far.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need to change this macro, the splat arg name cannot be used in a call IIRC, so cannot clash

Copy link
Member

Choose a reason for hiding this comment

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

That too, but I guess it means this is just a bug in macro splat

Copy link
Contributor

@bew bew Dec 5, 2017

Choose a reason for hiding this comment

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

Nevermind, forget what I said, I didn't know one could do https://carc.in/#/r/37af
I thought this would give:

{props: {a: 1}}

instead (maybe that's what it should do?)

Copy link
Member

Choose a reason for hiding this comment

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

@oprypin Both need to be renamed. Otherwise mapping(properties: String) would still match the other signature.

@Sija
Copy link
Contributor Author

Sija commented Dec 15, 2017

ping?

@Sija
Copy link
Contributor Author

Sija commented Dec 20, 2017

Could we get this merged after 2 weeks of silence?

@RX14 RX14 added this to the Next milestone Jan 2, 2018
@RX14 RX14 merged commit 31c15be into crystal-lang:master Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants