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