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

Failed to demangle superclass when using Objective-C type as type argument

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: None
    • Labels:
    • Environment:
      Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
      Target: x86_64-apple-darwin18.2.0
      

      Description

      1.h

      #import <Foundation/Foundation.h>
      @interface Foo : NSObject
      @end;
      

      1.swift:

      class Base<T> {}
      class Derived : Base<Foo> {}
      
      Derived()
      
      $ swiftc 1.swift -import-objc-header 1.h
      

      The resulting binary crashes with

      failed to demangle superclass of Derived from mangled name 'M???ySo3FooCG'
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            SvyatoslavScherbina Svyatoslav Scherbina
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: