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
Trying to create a project where the Query filtering components and the Model components, that are outside of the scope of SwiftKuery/SwiftKueryORM/etc..., are in individual frameworks. The framework that mainly interacts with the Models in my implementation, doesn't allow for the models to directly access the Query.framework. Query.framework has access to Models.framework, but Models.framework does not have access to Query.framework. Both have access to SwiftKuery/SwiftQueryORM/etc..
There are additional enhancements to filtering, beyond filtering by ID as well as additional updateOrInsert handling that I've worked on. Though, the models don't have access to this. To solve my problem, I'd need to flip it, so that Models.framework imports Query.framework, and then add an extension to the SwiftKueryORM.Model to be able to do the work that Query.framework is already doing. I would prefer that the models be agnostic to the Query.framework, but it seems that is not the way SwiftKueryORM.Model wants it. Spent 12 hours trying to find a way around it, but it seems that all the Self references in the Model.swift protocol and extension prevent that.
Environment Details
Running macOS 10.14.1, Xcode 10.1, Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Steps to Reproduce
Create a method that returns Model.Type or a method that accepts a parameter as Model
Swift errors will be displayed.
Expected vs. Actual Behaviour
Expected: Ability to pass Model to a method without having to use extensions on the model.
Actual: Error message displays saying the protocol can't be used as a parameter or even as a return type, such as Model.Type
publicstruct RandomModel : Model
public fileprivate(set)vardate:Datepublicfileprivate(set)varupdated:Datepublicfileprivate(set)varuuid:UUID?// ...}publicfinalclassRandomClass{// error displayed for the return value.func modelType()->Model.Type{returnRandomModel.self
}// error displayed for the parameter type.func handleModel(_ model:Model){// ...}}
Error Message Displayed
Protocol 'Model' can only be used as a generic constraint because it has Self or associated type requirements
The text was updated successfully, but these errors were encountered:
Context and Description
Trying to create a project where the Query filtering components and the Model components, that are outside of the scope of SwiftKuery/SwiftKueryORM/etc..., are in individual frameworks. The framework that mainly interacts with the Models in my implementation, doesn't allow for the models to directly access the
Query.framework
.Query.framework
has access toModels.framework
, butModels.framework
does not have access toQuery.framework
. Both have access to SwiftKuery/SwiftQueryORM/etc..There are additional enhancements to filtering, beyond filtering by ID as well as additional
updateOrInsert
handling that I've worked on. Though, the models don't have access to this. To solve my problem, I'd need to flip it, so thatModels.framework
importsQuery.framework
, and then add an extension to theSwiftKueryORM.Model
to be able to do the work thatQuery.framework
is already doing. I would prefer that the models be agnostic to theQuery.framework
, but it seems that is not the waySwiftKueryORM.Model
wants it. Spent 12 hours trying to find a way around it, but it seems that all theSelf
references in theModel.swift
protocol and extension prevent that.Environment Details
Running macOS 10.14.1, Xcode 10.1, Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Steps to Reproduce
Model.Type
or a method that accepts a parameter asModel
Expected vs. Actual Behaviour
Model.Type
Error Message Displayed
The text was updated successfully, but these errors were encountered: