Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed nested type resolution #1384

Merged

Conversation

till0xff
Copy link
Contributor

Fixed nested type resolution in an extension with a global type name in the same module.

Example

File Moya.xcframework/ios-arm64_x86_64-simulator/Moya.framework/Modules/Moya.swiftmodule/arm64-apple-ios-simulator.swiftinterface

final public class NetworkActivityPlugin : Moya.PluginType {
  public typealias NetworkActivityClosure = (_ change: Moya.NetworkActivityChangeType, _ target: Moya.TargetType) -> Swift.Void
  public init(networkActivityClosure: @escaping Moya.NetworkActivityPlugin.NetworkActivityClosure)
  final public func willSend(_ request: Moya.RequestType, target: Moya.TargetType)
  final public func didReceive(_ result: Swift.Result<Moya.Response, Moya.MoyaError>, target: Moya.TargetType)
  @objc deinit
}

//...

extension Moya.NetworkLoggerPlugin {
  public struct Configuration {
    public typealias OutputType = (_ target: Moya.TargetType, _ items: [Swift.String]) -> Swift.Void
    public var formatter: Moya.NetworkLoggerPlugin.Configuration.Formatter
    public var output: Moya.NetworkLoggerPlugin.Configuration.OutputType
    public var logOptions: Moya.NetworkLoggerPlugin.Configuration.LogOptions
    public init(formatter: Moya.NetworkLoggerPlugin.Configuration.Formatter = Formatter(), output: @escaping Moya.NetworkLoggerPlugin.Configuration.OutputType = defaultOutput, logOptions: Moya.NetworkLoggerPlugin.Configuration.LogOptions = .default)
    public static func defaultOutput(target: Moya.TargetType, items: [Swift.String])
  }
}

Sourcery fails with error:

SourceryRuntime/ParserResultsComposed.swift:151: Assertion failed: Type Moya.NetworkLoggerPlugin.Configuration should be extension

@till0xff till0xff force-pushed the fix-nested-type-resolution branch from 5e97c9d to 13717d1 Compare November 12, 2024 14:31
@till0xff till0xff changed the title Fixed nested type resolution WIP: Fixed nested type resolution Nov 13, 2024
@till0xff till0xff force-pushed the fix-nested-type-resolution branch from 13717d1 to cd424f0 Compare November 13, 2024 14:46
@till0xff till0xff changed the title WIP: Fixed nested type resolution Fixed nested type resolution Nov 13, 2024
@krzysztofzablocki krzysztofzablocki merged commit 74275e8 into krzysztofzablocki:master Nov 21, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants