periphery
periphery copied to clipboard
False positive calling internal init through typealias
I believe I have a false positive when calling an internal init on a type using a typealias.
You can reproduce the false positive using my websocket-actor-system code. Just type periphery scan in the top-level directory.
The init is on line 22 of NIOInvocationDecoder.swift.
public class NIOInvocationDecoder: DistributedTargetInvocationDecoder {
public typealias SerializationRequirement = any Codable
let decoder: JSONDecoder
let envelope: RemoteWebSocketCallEnvelope
let logger: Logger
var argumentsIterator: Array<Data>.Iterator
internal init(system: WebSocketActorSystem, envelope: RemoteWebSocketCallEnvelope) {
self.envelope = envelope
self.logger = system.logger
self.argumentsIterator = envelope.args.makeIterator()
let decoder = JSONDecoder()
decoder.userInfo[.actorSystemKey] = system
self.decoder = decoder
}
The typealias is on line 84 of WebSocketActorSystem.swift
public typealias InvocationDecoder = NIOInvocationDecoder
The call to this init is on line 419 of WebSocketActorSystem.swift.
var decoder = Self.InvocationDecoder(system: self, envelope: envelope)
Unfortunately, this appears to be caused by a Swift compiler bug.