-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrency safe handler #276
Changes from all commits
a9a5502
4642bc9
8f081e4
ec1e646
4aad37f
5365599
bbbec5f
1d89eb8
e84af32
fe8d1a3
a5f5b57
1294be2
7ce0343
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ struct ResolvedEntity { | |
var uniqueModels: [(String, Model)] | ||
var attributes: [String] | ||
var inheritedTypes: [String] | ||
var inheritsActorProtocol: Bool | ||
|
||
var declaredInits: [MethodModel] { | ||
return uniqueModels.compactMap { (_, model) in | ||
|
@@ -39,6 +38,10 @@ struct ResolvedEntity { | |
) | ||
} | ||
|
||
var inheritsActorProtocol: Bool { | ||
return inheritedTypes.contains(.actorProtocol) | ||
} | ||
|
||
/// Returns models that can be used as parameters to an initializer | ||
/// @param models The models of the current entity including unprocessed (ones to generate) and | ||
/// processed (already mocked by a previous run if any) models. | ||
|
@@ -56,19 +59,23 @@ struct ResolvedEntity { | |
return result | ||
} | ||
|
||
var requiresSendable: Bool { | ||
return inheritedTypes.contains(.sendable) || inheritedTypes.contains(.error) | ||
} | ||
Comment on lines
+62
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [question]
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The mock of an |
||
|
||
func model() -> Model { | ||
return NominalModel(identifier: key, | ||
namespaces: entity.entityNode.namespaces, | ||
acl: entity.entityNode.accessLevel, | ||
declKindOfMockAnnotatedBaseType: entity.entityNode.declKind, | ||
declKind: inheritsActorProtocol ? .actor : .class, | ||
inheritedTypes: inheritedTypes, | ||
attributes: attributes, | ||
offset: entity.entityNode.offset, | ||
metadata: entity.metadata, | ||
initParamCandidates: initParamCandidates, | ||
declaredInits: declaredInits, | ||
entities: uniqueModels) | ||
entities: uniqueModels, | ||
requiresSendable: requiresSendable) | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question]
I am sorry but could you elaborate why you delete
inheritedTypes
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it is never used.
It might be back in the future if needed.