Skip to content

Use backticks for keywords in NameAllocator #1625

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

Closed
wants to merge 1 commit into from

Conversation

Egorand
Copy link
Collaborator

@Egorand Egorand commented Jul 12, 2023

No description provided.

@Egorand Egorand force-pushed the egor.230712.name-allocator-keywords branch from 3a22a55 to 8bedc55 Compare January 11, 2024 16:06
@JakeWharton
Copy link
Collaborator

One problem with this is that if you use the name in an output somewhere it will become backticked. You can see this in your Wire PR where the toString() becomes `when`=blah instead of when=blah.

@JakeWharton
Copy link
Collaborator

Can we return "when" and require the use of %N which does(?) the backtick escaping?

@Egorand
Copy link
Collaborator Author

Egorand commented Jan 11, 2024

Yep, %N does backticks. Do you mean require its use in Wire? I think it's worth trying!

@JakeWharton
Copy link
Collaborator

Do you mean require its use in Wire?

I more meant in general. If we start returning "when" directly, then people using string templating will start to get code that doesn't compile. Are we comfortable saying "You should have been using/must use %N"?

@Egorand
Copy link
Collaborator Author

Egorand commented Jan 12, 2024

I think eventually (in 2.0 probably?) we should do that. To avoid breaking current behaviour though, @swankjesse & I decided to introduce API to control how keywords are treated: #1803.

@Egorand
Copy link
Collaborator Author

Egorand commented Jan 15, 2024

Closed in favour of #1803.

@Egorand Egorand closed this Jan 15, 2024
@Egorand Egorand deleted the egor.230712.name-allocator-keywords branch January 15, 2024 15:58
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.

2 participants