-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Check variable implements a protocol #40
Comments
Hi @bolismauro . Yes it is possible. When you have |
What I'm trying to achieve is this
with this struct struct Book: AutoEquatable {
let name: String
let author: String
let numPages: Int
} I get an empty file (completely empty). I guess there is some kind of problem in the template, because at least some part of the code should be generated. Is it because I'm trying to work with types (Int, String, ...) that are not declared in the project but in the Apple framework? |
You should have For variables |
I tried it before writing but I didn't restart sourcery (it was in watch mode) and that's why I didn't see changes. The problem is that I have to let sourcery find the In general I think it would be extremely useful to access to built-in types, but I guess it would take a lot of time to analyse all that code, right? Thanks for the help :) |
We could in theory run Sourcery against iOS frameworks and cache meta-data informations in the tool, but we'd need to make sure it's updated properly etc so not sure if that's something we should tackle yet. @bolismauro you can use source annotations to skip, take a look at docs |
I'll add ability to check conformance as in #42 |
Makes sense @krzysztofzablocki I think we can close this if it is ok for you |
Glad to hear, we are very actively working on features so more and more should be possible with less burden soon :) |
Hi!
First of all great work!
I had the same idea from months but I've never found the time to implement it. Very great work :)
I'm trying to understand how to check if a variable (of a struct) implements a protocol but I can't find a way.
Is it possible? it could be that I'm missing something though (I just started to try the project)
The text was updated successfully, but these errors were encountered: