Skip to content
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

Auto-Injection warnings #139

Closed
ArtFeel opened this issue Dec 9, 2016 · 3 comments
Closed

Auto-Injection warnings #139

ArtFeel opened this issue Dec 9, 2016 · 3 comments
Labels

Comments

@ArtFeel
Copy link

ArtFeel commented Dec 9, 2016

Hi, I'm new to Swift, maybe I'm doing something wrong, but in Wiki, there is the same code example

private let injectedApiClient = Injected<APIClient>()
var apiClient: APIClient? { return injectedApiClient.value }

But, when I'm doing like this, I received warnings:

Warning:(22, 20) expression implicitly coerced from 'APIClient?' to Any
Note:(22, 20) provide a default value to avoid this warning
Note:(22, 20) force-unwrap the value to avoid this warning
Note:(22, 20) explicitly cast to Any with 'as Any' to silence this warning
@ilyapuchka
Copy link
Collaborator

Never saw these warnings. What version of Xcode do you use?

@ilyapuchka
Copy link
Collaborator

ilyapuchka commented Dec 10, 2016

I guess it has something to do with this bug https://bugs.swift.org/browse/SR-2921. Will close that and add it to Swift 3 issues list.

@ilyapuchka ilyapuchka mentioned this issue Dec 10, 2016
5 tasks
@ArtFeel
Copy link
Author

ArtFeel commented Dec 11, 2016

Sorry, this bug appears only in AppCode, I think I should fill a bug report. In XCode 8.1 everything is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants