<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">The type comes from XCTest. I’m trying to enumerate Objective-C methods in order to use them with XCTest in the open-source Swift version of XCTest, which needs the tests to be supplied as this type:</div><div class=""><br class=""></div><div class=""><pre style="word-wrap: break-word; white-space: pre-wrap;" class="">/// This is a compound type used by `XCTMain` to represent tests to run. It combines an
/// `XCTestCase` subclass type with the list of test case methods to invoke on the class.
/// This type is intended to be produced by the `testCase` helper function.
/// - seealso: `testCase`
/// - seealso: `XCTMain`
public typealias XCTestCaseEntry = (testCaseClass: XCTestCase.Type, allTests: [(String, (XCTestCase) throws -> Void)])</pre><div class=""><br class=""></div></div><div class=""><br class=""></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: normal; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Jeff Kelley</div><div class=""><br class=""></div><div class=""><a href="mailto:SlaunchaMan@gmail.com" class="">SlaunchaMan@gmail.com</a> | <a href="https://twitter.com/SlaunchaMan" class="">@SlaunchaMan</a> | <a href="http://jeffkelley.org" class="">jeffkelley.org</a></div></div></span></div></div></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Nov 21, 2016, at 1:13 AM, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">"throws" is the part that's not representable in Obj-C. Why are you using it? If you're interacting with method_getImplementation, you need to think like the Obj-C runtime.<div class=""><br class=""></div><div class=""><a href="https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtHowMessagingWorks.html#//apple_ref/doc/uid/TP40008048-CH104-SW1" class="">https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtHowMessagingWorks.html#//apple_ref/doc/uid/TP40008048-CH104-SW1</a><br class=""><div class=""><br class=""></div><div class="">This works:</div><div class=""><br class=""></div><div class=""> typealias DescriptionMethod = @convention(c) (NSObject, Selector) -> NSString </div><div class=""><br class=""></div><div class=""> let fn = unsafeBitCast(method_getImplementation(class_getInstanceMethod(NSObject.self, "description")), DescriptionMethod.self)</div><div class=""><br class=""></div><div class=""> fn(NSObject(), "description") as String</div><div class=""><br class=""></div><div class=""><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class="">Jacob<br class=""></div></div></div></div>
<br class=""><div class="gmail_quote">On Sun, Nov 20, 2016 at 9:41 PM, Jeff Kelley <span dir="ltr" class=""><<a href="mailto:slaunchaman@gmail.com" target="_blank" class="">slaunchaman@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class="">Still trying on this (copied the code directly, Foo is actually XCTestCase):<div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(4,51,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> TestMethod = </span><span style="font-variant-ligatures:no-common-ligatures" class="">@convention</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(c) (</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">XCTestCase</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) </span><span style="font-variant-ligatures:no-common-ligatures" class="">throws</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> -> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">Void</span></div></div><div class=""><br class=""></div><div class="">This seagulls the compiler with “<span style="font-family:menlo;font-size:11px" class="">error: '(XCTestCase) throws -> Void' is not representable in Objective-C, so it cannot be used with '@convention(c)</span><font face="Menlo" class=""><span style="font-size:11px" class="">’</span></font>”. I’m trying to use it here:</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">let</span><span style="font-variant-ligatures:no-common-ligatures" class=""> testMethod: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">IMP</span><span style="font-variant-ligatures:no-common-ligatures" class=""> = method_getImplementation(<wbr class="">method)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""></span><br class=""></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">let</span><span style="font-variant-ligatures:no-common-ligatures" class=""> test: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">TestMethod</span><span style="font-variant-ligatures:no-common-ligatures" class=""> = unsafeBitCast(testMethod,</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> to: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">TestMethod</span><span style="font-variant-ligatures:no-common-ligatures" class="">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">self</span><span style="font-variant-ligatures:no-common-ligatures" class="">)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""></span><br class=""></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">testMethods.append((methodName </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">as</span><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">String</span><span style="font-variant-ligatures:no-common-ligatures" class="">, test))</span></div></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div class="">If I try to put the type directly in the call to unsafeBitCast(), the compiler gives me an error:</div><div class=""><br class=""></div><div class=""><div style="margin:0px 0px 0px 12px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class="">Attribute can only be applied to types, not declarations<b class=""></b></div><div style="margin:0px 0px 0px 12px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class=""><br class=""></div></div><div class="">Thanks for your suggestions! I hadn’t seen @convention() before.</div><div class=""><br class=""></div><div class=""><span class="gmail-"><br class=""><div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="font-family: helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="font-family: helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="font-family: helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="font-family: helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><span class="gmail-m_9151264134778263134Apple-style-span" style="border-collapse:separate;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:normal"><div style="word-wrap:break-word" class=""><div class="">Jeff Kelley</div><div class=""><br class=""></div><div class=""><a href="mailto:SlaunchaMan@gmail.com" target="_blank" class="">SlaunchaMan@gmail.com</a> | <a href="https://twitter.com/SlaunchaMan" target="_blank" class="">@<wbr class="">SlaunchaMan</a> | <a href="http://jeffkelley.org/" target="_blank" class="">jeffkelley.org</a></div></div></span></div></div></div></div></div>
</div>
<br class=""></span><div class=""><div class="gmail-h5"><div class=""><blockquote type="cite" class=""><div class="">On Nov 21, 2016, at 12:08 AM, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" target="_blank" class="">jtbandes@gmail.com</a>> wrote:</div><br class="gmail-m_9151264134778263134Apple-interchange-newline"><div class=""><div dir="ltr" class="">For a function such as bar() above, the type you want to cast the IMP to would probably be "@convention(c) (Foo, Selector) -> ()".<div class="gmail_extra">
<br class=""><div class="gmail_quote">On Sun, Nov 20, 2016 at 9:05 PM, Jeff Kelley <span dir="ltr" class=""><<a href="mailto:slaunchaman@gmail.com" target="_blank" class="">slaunchaman@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class="">Thanks Jacob! I tried using unsafeBitCast, but it fails with the following: “fatal error: can't unsafeBitCast between types of different sizes”. I considered wrapping every call in a closure that calls objc_msgSend(), but alas, that’s not exposed to Swift. I have another approach in mind, so I’ll try that next.<div class=""><br class=""></div><div class=""><span class=""><br class=""><div class="">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><div style="font-family:helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><div style="font-family:helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><div style="font-family:helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><div style="font-family:helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><span class="gmail-m_9151264134778263134m_-5343275286513492557Apple-style-span" style="border-collapse:separate;font-family:helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word" class=""><div class="">Jeff Kelley</div><div class=""><br class=""></div><div class=""><a href="mailto:SlaunchaMan@gmail.com" target="_blank" class="">SlaunchaMan@gmail.com</a> | <a href="https://twitter.com/SlaunchaMan" target="_blank" class="">@Slaun<wbr class="">chaMan</a> | <a href="http://jeffkelley.org/" target="_blank" class="">jeffkelley.org</a></div></div></span></div></div></div></div></div>
</div>
<br class=""></span><div class=""><div class="gmail-m_9151264134778263134h5"><div class=""><blockquote type="cite" class=""><div class="">On Nov 19, 2016, at 1:58 AM, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" target="_blank" class="">jtbandes@gmail.com</a>> wrote:</div><br class="gmail-m_9151264134778263134m_-5343275286513492557Apple-interchange-newline"><div class=""><div dir="ltr" class="">I imagine unsafeBitCast would be the way to go here. But are you assuming that all of the instance methods have type "(Foo) throws -> Void" ? Or do you somehow want to dynamically use the type information?<div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail-m_9151264134778263134m_-5343275286513492557gmail_signature"><div dir="ltr" class=""><div class="">Jacob<br class=""></div></div></div></div>
<br class=""><div class="gmail_quote">On Fri, Nov 18, 2016 at 10:37 PM, Jeff Kelley via swift-users <span dir="ltr" class=""><<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class="">Hello,<div class=""><br class=""></div><div class=""><span class="gmail-m_9151264134778263134m_-5343275286513492557m_-7480237009779366933Apple-tab-span" style="white-space:pre-wrap">        </span>I’m trying to enumerate the methods of a class in Swift using the Objective-C runtime. Everything is working fine so far, except for the very last step. Suppose I have a Swift class like this:</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">class</span><span style="font-variant-ligatures:no-common-ligatures" class=""> Foo</span><span style="font-variant-ligatures:no-common-ligatures" class="">: </span><span style="color:rgb(52,149,175);font-variant-ligatures:no-common-ligatures" class="">SomeSuperclass</span> {</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><br class="gmail-m_9151264134778263134m_-5343275286513492557m_-7480237009779366933webkit-block-placeholder"></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">@objc</span><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">func</span><span style="font-variant-ligatures:no-common-ligatures" class=""> bar() {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(180,38,26)" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">print</span><span style="font-variant-ligatures:no-common-ligatures" class="">(</span><span style="font-variant-ligatures:no-common-ligatures" class="">"Hello, World!"</span><span style="font-variant-ligatures:no-common-ligatures" class="">)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> }</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><br class="gmail-m_9151264134778263134m_-5343275286513492557m_-7480237009779366933webkit-block-placeholder"></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">}</span></div></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><br class=""></div><div class=""><span class="gmail-m_9151264134778263134m_-5343275286513492557m_-7480237009779366933Apple-tab-span" style="white-space:pre-wrap">        </span>Using the Objective-C runtime methods, I can get the method with <span style="color:rgb(52,149,175);font-family:menlo;font-size:11px" class="">class_copyMethodList</span> and then get to the method’s implementation using <span style="color:rgb(52,149,175);font-family:menlo;font-size:11px" class="">method_getImplementation</span><wbr class="">. However, what I need to do next is to stick this into a tuple that looks like this:</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">typealias</span><span style="font-variant-ligatures:no-common-ligatures" class=""> FooEntry = (fooClass: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">SomeSuperclass</span><span style="font-variant-ligatures:no-common-ligatures" class="">.Type, methods: [(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">String</span><span style="font-variant-ligatures:no-common-ligatures" class="">, (</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">Foo</span><span style="font-variant-ligatures:no-common-ligatures" class="">) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">throws</span><span style="font-variant-ligatures:no-common-ligatures" class=""> -> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">Void</span><span style="font-variant-ligatures:no-common-ligatures" class="">)])</span></div></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div class=""><span class="gmail-m_9151264134778263134m_-5343275286513492557m_-7480237009779366933Apple-tab-span" style="white-space:pre-wrap">        </span>For now, the workaround is to make a static variable that returns all of the entries:</div><div class=""><br class=""></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">static</span><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">var</span><span style="font-variant-ligatures:no-common-ligatures" class=""> allEntries = {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(4,51,255)" class="">return</span><span style="font-variant-ligatures:no-common-ligatures" class=""> [</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> (</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)" class="">"bar"</span><span style="font-variant-ligatures:no-common-ligatures" class="">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="">bar</span><span style="font-variant-ligatures:no-common-ligatures" class="">),</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> ]</span></div><div class=""><span style="font-family:menlo;font-size:11px" class=""> </span><span style="font-family:menlo;font-size:11px" class="">}</span></div><div class=""><br class=""></div><div class=""><span class="gmail-m_9151264134778263134m_-5343275286513492557m_-7480237009779366933Apple-tab-span" style="white-space:pre-wrap">        </span>Is there any way to go from the raw <span style="color:rgb(52,149,175);font-family:menlo;font-size:11px" class="">IMP</span> that I get back from the runtime to the Swift type so I can construct this list dynamically?</div><div class=""><br class=""></div><div class=""><br class=""><div class="">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><div style="font-family:helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><div style="font-family:helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><div style="font-family:helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><div style="font-family:helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word" class=""><span class="gmail-m_9151264134778263134m_-5343275286513492557m_-7480237009779366933Apple-style-span" style="border-collapse:separate;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:normal"><div style="word-wrap:break-word" class=""><div class="">Jeff Kelley</div><div class=""><br class=""></div><div class=""><a href="mailto:SlaunchaMan@gmail.com" target="_blank" class="">SlaunchaMan@gmail.com</a> | <a href="https://twitter.com/SlaunchaMan" target="_blank" class="">@Slaun<wbr class="">chaMan</a> | <a href="http://jeffkelley.org/" target="_blank" class="">jeffkelley.org</a></div></div></span></div></div></div></div></div>
</div>
<br class=""></div></div><br class="">______________________________<wbr class="">_________________<br class="">
swift-users mailing list<br class="">
<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailma<wbr class="">n/listinfo/swift-users</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></div></div>
</div></blockquote></div><br class=""></body></html>