Skip to content

@inlinable attributes on _TinyArray cause errors in xcodebuild #254

Description

@xcodedave

Hi,

I'm experiencing issues with version 1.10.0 when attempting to archive a distributable static library including swift-certificates as a dependency.

the _TinyArray type defines a few @inlinable nested types.

No explicit init function for _TinyArray is provided, and instead the synthesized internal init is used throughout various specialized initializers.

Unfortunately, this causes errors when building as an xcode archive for distribution, such as the following:

_TinyArray.swift:78:22: error: 'self' used before 'self.init' call or assignment to 'self'
        self.storage = .init(elements)
                     ^

I have created a simple demonstration of the issue here:
https://github.com/xcodedave/swift-certificates-issue

It includes a potential fix which is to provide an explicit init marked with the @usableFromInline attribute, and update property setting within specialized initializers to adopt the new explicit initializer.

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