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

[SR-3969] Improve ExpressibleByStringInterpolation #46554

Closed
DougGregor opened this issue Feb 15, 2017 · 3 comments
Closed

[SR-3969] Improve ExpressibleByStringInterpolation #46554

DougGregor opened this issue Feb 15, 2017 · 3 comments
Assignees
Labels
compiler The Swift compiler in itself feature A feature request or implementation improvement standard library Area: Standard library umbrella swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented

Comments

@DougGregor
Copy link
Member

Previous ID SR-3969
Radar None
Original Reporter @DougGregor
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, StarterProposal
Assignee @beccadax
Priority Medium

md5: bede4bfd0f4d70aa00d80aeb18e7800d

is duplicated by:

  • SR-6445 The documentation doesn't make it clear what replaces ExpressibleByStringInterpolation

relates to:

  • SR-1260 ExpressibleByStringInterpolation: can't distinguish between literal components and String arguments
  • SR-2303 ExpressibleByStringInterpolation: ability to restrict types used in string interpolation

Issue Description:

The ExpressibleByStringInterpolation protocol could benefit from an overhaul. Some of the problems with the existing protocol include:

  • It doesn't distinguish between "string parts" and "interpolated parts"

  • The segments are always of the same type as the interpolated string literal, which is limiting

@beccadax
Copy link
Contributor

I've written a proposal (with a prototype) for an overhauled ExpressibleByStringInterpolation protocol.

@jckarter
Copy link
Member

jckarter commented Apr 7, 2017

Another thing to consider in a revision of string interpolation: should ExpressibleByStringLiteral imply ExpressibleByStringInterpolation if the literal type is interpolable? The failure mode of https://twitter.com/owensd/status/850127817530408960 is nonobvious.

@beccadax
Copy link
Contributor

beccadax commented Mar 9, 2019

Resolved by SE-0228.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented standard library Area: Standard library umbrella feature A feature request or implementation and removed StarterProposal labels Nov 11, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself feature A feature request or implementation improvement standard library Area: Standard library umbrella swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented
Projects
None yet
Development

No branches or pull requests

4 participants