Swift can't call the appropriate class method given a generic type if it's the same as a parent type

Originator:jp
Number:rdar://21672269 Date Originated:03-Jul-2015 04:08 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-7 (7A121l)
Classification:Other Bug Reproducible:Always
 
Summary:
Given the following Objective-C class:

```
@interface ClassWithName : NSObject
+ (NSString *)className;
@end
@implementation ClassWithName
+ (NSString *)className {
    return @"ClassWithName";
}
@end
```

the following Swift code should compile:

```
func test<T: ClassWithName>(type: T) {
    ClassWithName.className() // compiles
    T.className() // doesn't compile: `ambiguous use of 'className'`
}
```

Steps to Reproduce:
Write the code above.

Expected Results:
I’d expect the code to compile.

Actual Results:
The code doesn’t compile with the following error message diagnostic: `ambiguous use of 'className’`.

Regression:
This compiled and called the appropriate class method in Xcode 7 Beta 1.

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!