Skip to content

Conversation

@lzell
Copy link
Contributor

@lzell lzell commented Aug 6, 2024

When trying to set the service as a member on a type, you can hit the compilation error:

Property definition has inferred type 'some OpenAIService', involving the 'some' return type of another declaration

To work around the compilation error, I could specify let service: some OpenAIService = .... A better fix, though, is to remove the some keyword on the factory methods. We don't need some here, because the protocol that our concrete types are conforming to is not a PAT. We don't need to use 'reverse generics' and can instead just rely on vanilla polymorphism through protocols.

Screenshot 2024-08-06 at 09 25 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants