{"action":"opened","issue":{"url":"https://api.github.com/repos/terhechte/CoreValue/issues/14","repository_url":"https://api.github.com/repos/terhechte/CoreValue","labels_url":"https://api.github.com/repos/terhechte/CoreValue/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/terhechte/CoreValue/issues/14/comments","events_url":"https://api.github.com/repos/terhechte/CoreValue/issues/14/events","html_url":"https://github.com/terhechte/CoreValue/issues/14","id":166590068,"number":14,"title":"Cannot invoke 'curry' with an argument list of type '((objectID: NSManagedObjectID?, name: String, employees: Array<StoredEmployee>) -> StoredCompany)","user":{"login":"emarashliev","id":176615,"avatar_url":"https://avatars.githubusercontent.com/u/176615?v=3","gravatar_id":"","url":"https://api.github.com/users/emarashliev","html_url":"https://github.com/emarashliev","followers_url":"https://api.github.com/users/emarashliev/followers","following_url":"https://api.github.com/users/emarashliev/following{/other_user}","gists_url":"https://api.github.com/users/emarashliev/gists{/gist_id}","starred_url":"https://api.github.com/users/emarashliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emarashliev/subscriptions","organizations_url":"https://api.github.com/users/emarashliev/orgs","repos_url":"https://api.github.com/users/emarashliev/repos","events_url":"https://api.github.com/users/emarashliev/events{/privacy}","received_events_url":"https://api.github.com/users/emarashliev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-20T14:06:56Z","updated_at":"2016-07-20T14:06:56Z","closed_at":null,"body":"We have next two separated files:\r\n\r\n```swift\r\n//  StoredCompany.swift\r\n\r\nimport CoreData\r\nimport CoreValue\r\n\r\n\r\nstruct StoredCompany: CVManagedPersistentStruct {\r\n    static let EntityName = \"Company\"\r\n    var objectID: NSManagedObjectID?\r\n    \r\n    var name: String\r\n    var employees: Array<StoredEmployee>\r\n    \r\n    static func fromObject(o: NSManagedObject) throws -> StoredCompany {\r\n        return try curry(self.init)\r\n            <^> o <|? \"objectID\"\r\n            <^> o <| \"name\"\r\n            <^> o <|| \"employees\"\r\n    }\r\n    \r\n    mutating func save(context: NSManagedObjectContext) throws {\r\n        try employees.saveAll(context)\r\n        \r\n        try defaultSave(context)\r\n    }\r\n```\r\n\r\n\r\n```swift\r\n//  StoredEmployee.swift\r\n\r\nimport CoreData\r\nimport CoreValue\r\n\r\n\r\nstruct StoredEmployee : CVManagedPersistentStruct {\r\n    static let EntityName = \"Employee\"\r\n    var objectID: NSManagedObjectID?\r\n    \r\n    let name: String\r\n    let age: Int16\r\n    let position: String?\r\n    let department: String\r\n    let job: String\r\n    \r\n    static func fromObject(o: NSManagedObject) throws -> StoredEmployee {\r\n        return try curry(self.init)\r\n            <^> o <|? \"objectID\"\r\n            <^> o <| \"name\"\r\n            <^> o <| \"age\"\r\n            <^> o <|? \"position\"\r\n            <^> o <| \"department\"\r\n            <^> o <| \"job\"\r\n    }\r\n}\r\n```\r\n\r\n\r\nThe compiler throws next error `.../StoredCompany.swift:21:20: Cannot invoke 'curry' with an argument list of type '((objectID: NSManagedObjectID?, name: String, employees: Array<StoredEmployee>) -> StoredCompany)'`\r\n\r\nIt's happens only when `struct StoredEmployee` and `struct StoredCompany` are in separated files. Probably that's the reason that the tests doesn't catch it. \r\n\r\n\r\nCheers! 🍻"}}
{"actor":{"display_login":"emarashliev"}}