<div dir="ltr"><div>I'm interested in fixing a pet peeve of mine: <a href="https://bugs.swift.org/browse/SR-772">https://bugs.swift.org/browse/SR-772</a></div><div><br></div><div>The failing assertion is in Array._forceBridgeFromObjectiveC, namely <span class="">Swift._isBridgedToObjectiveC(Element.</span><span class="">self</span><span class="">). </span><span class="">Element is plain ol "() -> ()", but probably should be @convention(block) since it was imported from void(^)(void).</span></div><div><br></div><div>I've started tracing through the importer, and I found that `adjustTypeForConcreteImport` is enforcing FunctionTypeRepresentation::Swift because the ImportKind is BridgedValue — this is hardcoded in the call to importType for the type parameters to NSArray (and NSDictionary and NSSet) in SwiftTypeConverter::VisitObjCObjectPointerType.</div>
<div><br></div><div>Are the Foundation collection classes only temporarily special-cased here, until Obj-C generics are generally supported? Is someone working on this in the near future?</div><div><br></div><div>If this worked correctly, would we expect to see "var executionBlocks: [@convention(block) () -> ()]" ? If so, would this be best achieved by passing a different ImportKind, possibly introducing a new ImportKind, or some other solution?</div><div><br></div><div>I'm guessing that it doesn't make sense for () -> () to be _ObjectiveCBridgeable, but either way I'm not sure where the _isBridgedToObjectiveC implementation for blocks would come from.</div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>Bumblingly,</div><div>Jacob<br></div></div></div></div>
</div>