How about adding attributes on extensions (just bikeshedding), because to me 
it’s not clear if you’re creating a class/static access label or for an 
instance of that type?

Nesting extensions would become useful for the sake of access labels.

struct A {
     
    public extension Self.foo {
        func someMethod() { … } // a.foo.someMethod()
    }    
     
    private extension Self.foo.bar {
        func someHiddenMethod() { … } // a.foo.bar.someHiddenMethod()  
    }
}

// Or
struct A {
     
    public extension self foo {
        func someMethod() { … } // a.foo.someMethod()
    }    
     
    private extension self.foo bar {
        func someHiddenMethod() { … } // a.foo.bar.someHiddenMethod()  
    }
}
The only problem I have with extensions, that they don’t read that well and 
personally I don’t like the default access modifier on them (not how its done 
right now).

Thank you for providing new ideas. :)



-- 
Adrian Zubarev
Sent with Airmail

Am 30. Juni 2016 um 21:57:37, Haravikk (swift-evolut...@haravikk.me) schrieb:

struct A {}
public extension A.foo {
func someMethod() { … } // a.foo.someMethod()
}
private extension A.foo.bar {
func someHiddenMethod() { … } // a.foo.bar.someHiddenMethod() 
}
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to