You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@JXFunc handles async function signatures that work with classes but not with actors. You can see this by changing TimePod to extend AnyActor, which (after fixing a couple other trivial issues) will fail (with "Generic parameter 'T' could not be inferred") to build the function:
@JXFunc var jxsleep = sleep
public func sleep(duration: TimeInterval) async throws
The reason is that a function reference to a class is (Self)->(Args…)->Result, but an Actor's will be (isolated Self)->(Args…)->Result.
I think this means that every asyncJXFunc initializer will need to have an additional initializer that accepts Self as isolated, unless some signature massaging can make one of them unnecessary.
@JXFunc
handles async function signatures that work with classes but not with actors. You can see this by changingTimePod
to extendAnyActor
, which (after fixing a couple other trivial issues) will fail (with "Generic parameter 'T' could not be inferred") to build the function:The reason is that a function reference to a class is
(Self)->(Args…)->Result
, but an Actor's will be(isolated Self)->(Args…)->Result
.I think this means that every
async
JXFunc
initializer will need to have an additional initializer that accepts Self asisolated
, unless some signature massaging can make one of them unnecessary.The text was updated successfully, but these errors were encountered: