Swift 2b3: Static functions cannot overload cases

Originator:rix.rob
Number:rdar://21783846 Date Originated:11-Jul-2015 09:11 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta (7A152u)
Classification:Other Bug Reproducible:Always
 
Summary:
Enums can have static variables shadowing their cases but not static functions.

Steps to Reproduce:
1. This code:
enum E<F> {
	case C
	case D(F)
}
extension E {
	static var C: () { return () }
	static func D(_:Int) -> () {}
}

Expected Results:
should compile

Actual Results:
but does not:
boom.swift:7:14: error: invalid redeclaration of 'D'
        static func D(_:Int) -> () {}
                    ^
boom.swift:3:7: note: 'D' previously declared here
        case D(F)
             ^

Regression:
The static variable C is acceptable, but the static function D is not. This despite the fact that it does not actually redeclare or even shadow the case or the static func implicitly defined by the case; it just overloads it on the return type.
The static variable C is only acceptable because E is generic, making me wonder if in fact the bug is that C compiles. But I think overloading on return type ought to be accepted here.

Notes:
N/A

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!