scala/scala — pull request #902 by paulp (2012-07-13 17:43:05+00:00)
Title: Implicits to encourage more Name-dropping.

[This is a "critical usability fix" -- and I submitted it a week ago, when the deadline was but a gleam in someone's eye.]

This creates implicits in cakes across the land from:

String => TermName
String => TypeName

And also from:

Name => NameOps[Name] // lower priority
TermName => NameOps[TermName]
TypeName => NameOps[TypeName]

What this is all about, using "drop" as a motivating example,
is that these should all work:

"abc" drop 1 // "bc": String
("abc": TermName) drop 1 // "bc": TermName
("abc": TypeName) drop 1 // "bc": TypeName
(("abc": TypeName): Name) drop 1 // "bc": Name

But this should not:

("bc": Name) // ambiguity error

This requires drop not being directly on Name; peer implicits
from String => TermName and String => TypeName; implicit
classes to install drop on TermName and TypeName; and a lower
priority implicit class to allow ops on Names.

Review by @xeno.by .