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

REPL incorrectly reports URL as nil

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: LLDB for Swift
    • Labels:
      None

      Description

      Here's a curious little conversation with the command line that came up on Stack Overflow lately:

      themini:~ mattneubelcap$ swift
      Welcome to Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7).
      Type :help for assistance.
        1> import Foundation
        2> let url = URL(string:"https://bugs.swift.org")
      url: URL? = nil
        3> print(url)
      Optional(https://bugs.swift.org)
        4> url == nil
      $R0: Bool = false
        5> url
      $R1: URL? = nil
      

      I have not tried to determine what other types behave this way, but I suspect is has to do with the Foundation overlay. This is interesting, if so, because I recently reported another bug involving LLDB incorrectly reporting nil for Optional Foundation overlay types (https://bugs.swift.org/browse/SR-11546).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jingham@apple.com Jim Ingham
              Reporter:
              mattneub Matt Neuburg
              Votes:
              11 Vote for this issue
              Watchers:
              15 Start watching this issue

                Dates

                Created:
                Updated: