Uploaded image for project: 'Swift'
  1. Swift
  2. SR-1882

String Interpolation of Optionals

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler
    • Labels:
      None

      Description

      As per discussion on Swift evolution (http://thread.gmane.org/gmane.comp.lang.swift.evolution/17575), Chris Lattner suggested it doesn't need to go through Swift evolution.

      Interpolation of an Optional should create a warning and offer two fix-it suggestions (http://article.gmane.org/gmane.comp.lang.swift.evolution/20960):

      a) Add redundant parentheses around the expression to silence the warning,
      b) Add " ?? <#placeholder#>" for adding a default value.

      I've originally thought I'd have a whack at it, but I won't have time until mid July to look around the compiler code, so I'm filing this as a bug report if anyone can get to it faster.

        Attachments

          Activity

            People

            Assignee:
            rwidmann Robert Widmann
            Reporter:
            charlieMonroe Charlie Monroe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: