Search code examples
swiftstructswift-extensions

Can't extend extension added structs on swift


I have CustomClass like so:

class CustomClass {
    let attribute: Int
}

In another file I've added it a StructureA via extension like so:

extension CustomClass {
    struct StructureA {
        let someData: Int
    }
}

In a third file, I'm attempting to extend my CustomClass.StructureA like this:

enter image description here

I don't get what's wrong about it. If I do the exact same implementation on the same file where I have the implementation of StructureA it works fine.

enter image description here

Any ideas on what I might be missing?


Solution

  • As mentioned by @Hamish, turns out it's a known bug:

    https://bugs.swift.org/browse/SR-631