We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我写了一个kt类如下: class ViewModelProviderFactory @Inject constructor(private val creators: Map<Class, Provider>) : ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>) = (creators[modelClass] ?: creators.filterKeys { it.isAssignableFrom(modelClass) }.values.first()).get() as T
} 然后我点击android studio->build->make project后生成的java类如下:
public final class ViewModelProviderFactory_Factory implements Factory<ViewModelProviderFactory> { private final Provider<Map<Class<? extends ViewModel>, ? extends Provider<ViewModel>>> creatorsProvider; public ViewModelProviderFactory_Factory( Provider<Map<Class<? extends ViewModel>, ? extends Provider<ViewModel>>> creatorsProvider) { this.creatorsProvider = creatorsProvider; } @Override public ViewModelProviderFactory get() { return new ViewModelProviderFactory(creatorsProvider.get()); } public static ViewModelProviderFactory_Factory create( Provider<Map<Class<? extends ViewModel>, ? extends Provider<ViewModel>>> creatorsProvider) { return new ViewModelProviderFactory_Factory(creatorsProvider); } public static ViewModelProviderFactory newInstance( Map<Class<? extends ViewModel>, ? extends Provider<ViewModel>> creators) { return new ViewModelProviderFactory(creators); } }
以上出现了一个问题:我并没有让Provider进行任何型变操作,生成的java类意外地出现了? extexds.我想这是一个bug!因为当我试着用java写这段代码时并没生成? extends而且代码运行正常.所以这是一个bug!
The text was updated successfully, but these errors were encountered:
You need to use @JvmSuppressWildcard; see #900 (comment)
@JvmSuppressWildcard
Sorry, something went wrong.
Thank you very much!
No branches or pull requests
我写了一个kt类如下:
class ViewModelProviderFactory @Inject
constructor(private val creators: Map<Class, Provider>) :
ViewModelProvider.Factory {
}
然后我点击android studio->build->make project后生成的java类如下:
以上出现了一个问题:我并没有让Provider进行任何型变操作,生成的java类意外地出现了? extexds.我想这是一个bug!因为当我试着用java写这段代码时并没生成? extends而且代码运行正常.所以这是一个bug!
The text was updated successfully, but these errors were encountered: