In the following example code it gives an error of 'Cannot assign value of type 'UIColor' to type 'UIColor!' ' It compiles fine without the generic in ExampleController.
import UIKit
final class ExampleController<T>: UITableViewController { }
UITableView.appearance(whenContainedInInstancesOf: [ExampleController.self]).tintColor = UIColor.blue
Ideally generic classes could be used with UIAppearance. However, the error message should at least reflect the real issue.
Yeah, you'll have to provide a specific ExampleController here, since the generic name "ExampleController" isn't itself a class at run time. You're totally right about the diagnostic, though.
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, DiagnosticsQoI, TypeChecker | |Assignee | None | |Priority | Medium | md5: 9d0d1fd9f4271291fe10ae1858692db5Issue Description:
In the following example code it gives an error of 'Cannot assign value of type 'UIColor' to type 'UIColor!' ' It compiles fine without the generic in ExampleController.
Ideally generic classes could be used with UIAppearance. However, the error message should at least reflect the real issue.