Skip to content

Generated mock for a specialized protocol is incorrect in Swift 6 language mode #347

@andriichernenko

Description

@andriichernenko

Consider the following protocol:

public protocol Foo<Value> {
    associatedtype Value
}

/// @mockable
public protocol NarrowFoo: Foo where Value == Int {}

The generated mock for it is

public final class NarrowFooMock<Value>: NarrowFoo where Value == Int {
    public init() { }
}

Which produces the following warning (in Swift 5 language mode):

Same-type requirement makes generic parameter 'Value' non-generic; this is an error in the Swift 6 language mode

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions