I'm trying to extend a struct that is already inside a struct. When I write the following code, I get
declaration is only valid at file scope.
struct A {
struct AA {
}
}
extension A {
extension AA {
}
}
Is it invalid to write an extension inside an extension?
It seems like the only way to do that is:
extension A.AA
{
func test()
{
print("Test")
}
}
It just worked in my playground
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With