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

Swift 5.2 toolchain ObjC Availability API crash

    XMLWordPrintable

    Details

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

      Xcode 11.3

      Toolchain: Swift 5.2 Snapshot 2020-01-06 (a)

      Description

      This code produces compiler crash:

       

      #import <Foundation/Foundation.h>
      
      @interface Foo : NSObject
      
      @end
      
      #import "Foo.h"
      
      @implementation Foo
      
      - (instancetype)init {
          self = [super init];
          if (self) {
              if (@available(iOS 9.0, *)) {
                  /*
                  Undefined symbols for architecture arm64:
                    "___isOSVersionAtLeast", referenced from:
                        -[Foo init] in Foo.o
                  ld: symbol(s) not found for architecture arm64
                  clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
                   */
              }
          }
          return self;
      }
      
      @end
      

       

      Project minimum deployment target - iOS 8

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            Agarunov Anton Agarunov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: