Allow implicit extensions in new type declarations

Originator:DeFrenZ
Number:rdar://23355695 Date Originated:02-Nov-2015 05:17 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Swift 2.0
Classification:Enhancement Reproducible:Always
 
Summary:
When defining new subtypes, you should be able to define them on an outer scope with the right hierarchy specified in the name.
e.g.
struct Foo {}
struct Foo.Bar {}

Currently you have to declare them inside the original type, either at declaration time or with an extension.
e.g.
struct Foo {
  struct Bar {}
}
or
struct Foo {}
extension Foo {
  struct Bar {}
}

Expected Results:
To be able to declare Foo.Bar as a subtype of Foo

Actual Results:
It doesn't compile

Regression:
None.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!