You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot invoke 'curry' with an argument list of type '((objectID: NSManagedObjectID?, name: String, employees: Array<StoredEmployee>) -> StoredCompany)
#14
Open
emarashliev opened this issue
Jul 20, 2016
· 4 comments
// StoredCompany.swift
import CoreData
import CoreValue
structStoredCompany:CVManagedPersistentStruct{staticletEntityName="Company"varobjectID:NSManagedObjectID?varname:Stringvaremployees:Array<StoredEmployee>staticfunc fromObject(o:NSManagedObject)throws->StoredCompany{returntrycurry(self.init)<^> o <|?"objectID"<^> o <|"name"<^> o <||"employees"}mutatingfunc save(context:NSManagedObjectContext)throws{try employees.saveAll(context)trydefaultSave(context)}
// StoredEmployee.swift
import CoreData
import CoreValue
structStoredEmployee:CVManagedPersistentStruct{staticletEntityName="Employee"varobjectID:NSManagedObjectID?letname:Stringletage:Int16letposition:String?letdepartment:Stringletjob:Stringstaticfunc fromObject(o:NSManagedObject)throws->StoredEmployee{returntrycurry(self.init)<^> o <|?"objectID"<^> o <|"name"<^> o <|"age"<^> o <|?"position"<^> o <|"department"<^> o <|"job"}}
The 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)'
It'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.
Cheers! 🍻
The text was updated successfully, but these errors were encountered:
We have next two separated files:
The 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)'
It's happens only when
struct StoredEmployee
andstruct StoredCompany
are in separated files. Probably that's the reason that the tests doesn't catch it.Cheers! 🍻
The text was updated successfully, but these errors were encountered: