Swift Foundation has an incomplete implementation of 
NSClassFromString/NSStringFromClass (link: 
https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSObjCRuntime.swift#L230-L282
 
<https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSObjCRuntime.swift#L230-L282>)
 due to a lack of a standardised method of encoding nested Swift classes, nor 
other Swift types.

I would think that given

module Contacts

class Person {
        struct Address {
                class Postcode {}
        }
}

Postcode would be encoded as Contacts.Person.Address.Postcode. Since it is not 
possible to have two different types with the same identifier in the same 
namespace (i.e. an enum/a class/a struct with the same name at the same 
declaration level) the encoding would similarly be simple. May I proceed under 
that assumption or are there ABI stability issues I have yet to consider?

Tom
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to