{"action":"closed","issue":{"url":"https://api.github.com/repos/mac-cain13/R.swift/issues/274","repository_url":"https://api.github.com/repos/mac-cain13/R.swift","labels_url":"https://api.github.com/repos/mac-cain13/R.swift/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/mac-cain13/R.swift/issues/274/comments","events_url":"https://api.github.com/repos/mac-cain13/R.swift/issues/274/events","html_url":"https://github.com/mac-cain13/R.swift/issues/274","id":181600517,"number":274,"title":"It's not possible to put nib resources in arrays and use it to call register","user":{"login":"mac-cain13","id":618233,"avatar_url":"https://avatars.githubusercontent.com/u/618233?v=3","gravatar_id":"","url":"https://api.github.com/users/mac-cain13","html_url":"https://github.com/mac-cain13","followers_url":"https://api.github.com/users/mac-cain13/followers","following_url":"https://api.github.com/users/mac-cain13/following{/other_user}","gists_url":"https://api.github.com/users/mac-cain13/gists{/gist_id}","starred_url":"https://api.github.com/users/mac-cain13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mac-cain13/subscriptions","organizations_url":"https://api.github.com/users/mac-cain13/orgs","repos_url":"https://api.github.com/users/mac-cain13/repos","events_url":"https://api.github.com/users/mac-cain13/events{/privacy}","received_events_url":"https://api.github.com/users/mac-cain13/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mac-cain13/R.swift/labels/state:%20confirmed","name":"state: confirmed","color":"E2A72C"},{"url":"https://api.github.com/repos/mac-cain13/R.swift/labels/type:%20issue","name":"type: issue","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-07T07:19:26Z","updated_at":"2016-10-08T10:33:11Z","closed_at":"2016-10-08T10:33:11Z","body":"Since Swift 3 you can't register an array of nib resources to a table or collection view since the compiler makes it an array of `() -> UINib` instead of `NibResourceType` / `ReuseIdentifierType` we need it to be.\r\n\r\nI suspect this is because of the complexer protocol setup for NibResources, this makes it harder for the compiler to infer the array to the type we need it to be.\r\n\r\nResults from the quick and dirty tests I did:\r\n\r\n```\r\n    let tv = UITableView()\r\n    tv.register(R.nib.cellView) // Correct\r\n    tv.register([R.nib.cellView]) // Correct\r\n    tv.register([R.nib.aDuplicateCellView]) // Correct\r\n    tv.register([R.nib.cellView, R.nib.aDuplicateCellView]) // Does not compile, bc wrong type of array\r\n\r\n    let a = R.nib.cellView // Correct\r\n    let b = R.nib.cellView.firstView(owner: nil) // Correct\r\n    let c = [R.nib.cellView]\r\n    let d = [R.nib.cellView, R.nib.aDuplicateCellView] // Wrong type `[() -> UINib]`\r\n    let e: [Rswift.NibResourceType] = [R.nib.cellView, R.nib.aDuplicateCellView] // Correct\r\n    let f = R.nib.cellView() // Correct\r\n\r\n    let g = R.image.colorsJpg // Correct\r\n    let h = [R.image.colorsJpg, R.image.eerste] // Correct\r\n```\r\n\r\nTo resolve this issue I think we should:\r\n- [ ] Simplify the protocol setup so the array is inferred to the expected type again\r\n- [ ] Add a `tv.register([...])` call to the test project to make sure this doesn't break again\r\n- [ ] Double check this is the only case that goes wrong"}}
{"actor":{"display_login":"mac-cain13"}}