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

Opaque result types cannot be used within a module on macOS 10.14

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Environment:

      Apple Swift version 5.1 (swiftlang-1100.0.38.29 clang-1100.0.20.14)
      Target: x86_64-apple-darwin18.6.0

      Description

      Opaque result types are resilient types, but this should only matter when crossing a module boundary. When declaring and using opaque result types within a single module, this should work on all OSes as it should be a compile-time-only feature in this scenario.

      Unfortunately, when I actually try this, I get a linker error.

      func foo() -> some CustomStringConvertible {
          return 42
      }
      print(foo())
      
      dyld: lazy symbol binding failed: Symbol not found: _swift_getOpaqueTypeMetadata
        Referenced from: /tmp/foo
        Expected in: /usr/lib/swift/libswiftCore.dylib
      
      dyld: Symbol not found: _swift_getOpaqueTypeMetadata
        Referenced from: /tmp/foo
        Expected in: /usr/lib/swift/libswiftCore.dylib
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Eridius Lily Ballard
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: