Commit Graph

2 Commits

Author SHA1 Message Date
David Farler
be86bcac1d [Migrator] Suggest String <-> Substring conversions
Some APIs that expected a String now expect a Substring and vice
versa. To ease the transition, emit fix-its on conversion errors
between these types that the migrator can pick up.

When converting from Substring -> String, suggest wrapping in
`String.init`.

When converting from String -> Substring, suggest appending the
void subscript `[]`. (This isn't implemented yet so this is
hidden behind a flag).

This can possibly be generalized later when converting between
some sequence and its subsequence, such as Array and ArraySlice,
for example.

rdar://problem/31665649
rdar://problem/31666638
2017-05-04 16:40:56 -07:00
David Farler
39a95f2dad [Migrator] Add Substring -> String conversion fix-it tests
There is no implicit conversion between String and Substring, so
the migrator can offer fix-its to convert between the two by wrapping
in String.init or adding the void subscript [] accordingly. This
commit just adds the tests for migration for the time being.

rdar://problem/30928902
2017-05-01 16:21:32 -07:00