-
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
Support actor
object via annotation metadata
#221
Support actor
object via annotation metadata
#221
Conversation
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.
Thx PR!!
} | ||
""" | ||
|
||
let argumentsObjectTypesWithActorAnnotation = |
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.
I would also like you to write the following test.
/// \(String.mockAnnotation)(object: actor)
protocol Foo: Bar {
func foo(arg: String) async -> Result<String, Error>
var bar: Int { get }
}
protocol Bar: Actor {
func baz(arg: String) async -> Result<String, Error>
var qux: Int { get }
}
import Foundation | ||
|
||
extension ActorModel { | ||
func applyActorTemplate(name: String, |
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.
Would you like to reduce a lot of duplication codes with ClassModel?
I have not good idea yet, but this size of duplications will cause future bug.
struct AnnotationMetadata { | ||
var objectType: ObjectType? |
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.
Please describe the usecase of this option.
Is it not enough when the protocol inherit Actor
?
(It seems that this option is added only to split the implementation 1 and 2 in #216 (comment))
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.
Oops, this is my misunderstanding. I understand 1 and 2 are not dependent of each other.
Same: #222 (comment) |
Issue
Part of #216
(#216 (comment) 's "1.")
Description
Add an annotation "object: class/actor" for specifying the object nominal types of the mock.
This allows the user to choose, at his/her own risk, whether to generate the mock for the protocol as a class or as an actor.
For details: #216 (comment)