Skip to content

False-positive using protocols and nested structs #1021

@meyers-oai

Description

@meyers-oai

Describe the bug
I've come across a false positive in my dependency injection setup. I'm not sure why, but I've simplified the repro case (attached) to 50 lines.
Didn't seem like this is related to any known bugs or open issues.

Reproduction
test-periphery.zip

Scanning will report the following 3 false-positives:

test-periphery/test/testApp.swift:21:8: warning: Struct 'DefaultCache' is unused
test-periphery/test/testApp.swift:51:7: warning: Property 'cache' is unused
test-periphery/test/testApp.swift:59:7: warning: Property 'cache' is unused

Environment
3.3.0
swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
Target: arm64-apple-macosx26.0
Xcode 26.1.1
Build version 17B100

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions