Skip to content

Cannot satisfy SPI protocol requirement with SPI default implementation #80313

Open
@ahoppen

Description

@ahoppen

If I have

public protocol Foo {
  @_spi(A) func foo()
}
extension Foo {
  @_spi(A) public func foo() {}
}

and a second module with

import Lib
struct A: Foo {}

I get the following error: Type 'A' does not conform to protocol 'Foo'

But the SPI protocol extension in Lib should be sufficient to satisfy the SPI protocol requirement: Either the client imports Lib with @_spi(A) in which case it would get both the requirement and the default implementation or it imports without SPI access, in which case it doesn’t see either the default implementation or the default requirement

Test.zip

rdar://147943518

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions