Skip to content

Get rid of the last implicit conversions from String to Names.#8537

Merged
retronym merged 2 commits intoscala:2.13.xfrom
sjrd:remove-string-to-name-implicits
Nov 20, 2019
Merged

Get rid of the last implicit conversions from String to Names.#8537
retronym merged 2 commits intoscala:2.13.xfrom
sjrd:remove-string-to-name-implicits

Conversation

@sjrd
Copy link
Member

@sjrd sjrd commented Nov 12, 2019

This requires a fair amount of explicit calls to createNameType in StdNames, which is not pleasing to the eye, but the result is a saner codebase nevertheless.

We use the opportunity to replace the n"foo" interopolator trick, which was used to avoid spurious "possible missing interpolator" warnings, by a simple concatenation like "$" + "foo".

In the scala-reflect API, we do not remove the methods to preserve binary compatibility. We simply drop their implicit marker, which is not source compatible but is binary compatible.


After that, we integrate methods of NameOps directly in Name.

Now that there are no more implicit conversion from String to Names, we can safely put those methods directly in Name, which is better for performance and readability. Previously, doing so would cause ambiguous implicit conversions between those and Predef.augmentString.

/cc @diesalbla @hrhino
Inspired by #8535.

Loading
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.

8 participants