# Conforming to public protocol using shared internal implementation

**URL:** <https://forums.swift.org/t/conforming-to-public-protocol-using-shared-internal-implementation/76715>\
**Category:** Using Swift\
**Tags:** generics, protocol-inheritance\
**Created:** [December 18, 2024, 5:57am UTC](https://forums.swift.org/t/conforming-to-public-protocol-using-shared-internal-implementation/76715 "2024-12-18T05:57:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerry1144](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jerry1144/32/38668_2.png) [@Jerry1144](https://forums.swift.org/u/Jerry1144)\
**Post date:** [December 18, 2024, 5:57am UTC](https://forums.swift.org/t/conforming-to-public-protocol-using-shared-internal-implementation/76715/1 "2024-12-18T05:57:49Z")

</div>

Hello, I got a function not found error when I tried to write a module like this:

```swift
public protocol ImportantProto {
    associatedtype T
    static func simpleExternal()
}

internal protocol MyImpl : ImportantProto {
    static func complicatedInnerCall(_:T,_:T,_:T,_:T,_:T,_:_:_:_:)
}

extension MyImpl {
    public static func simpleExternal() {
        lots;
        of;
        shared;
        boilerplate;
        generic;
        over;
        T;
        think;
        BLAS/lapack;
        return complicatedInnerCall( , , , , , , , , , )
    }
} // shared between types

public struct TypeOne : ImportantProto {
    typealias T = T1
} // simpleExternal() conformance comes below

extension TypeOne : MyImpl {
      complicatedInnerCall() { ... }
}

public struct TypeTwo : ImportantProto ...

```

Calling simpleExternal() from outside is "function not found", surprisingly: TypeOne is publicly declared to conform to ImportantProto, so publicly should have a simpleExternal() available.

I found [this back in 2018](https://forums.swift.org/t/allowing-non-public-methods-to-satisfy-public-protocol-requirements/14301), discussing essentially the same thing. The "Automatic generated public func shared() for every comforming type" proposal still isn't here yet.

The bottom line: is there a one-liner to manually declare/generate this public static simpleExternal() for each type?
