-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
a528638
commit 96da93b
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/test/testData/binds/FrameworkTypeReturn/FrameworkTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import javax.inject.Inject; | ||
import dagger.Module; | ||
import dagger.Provides; | ||
import dagger.Binds; | ||
import assets.Car; | ||
import assets.CarImpl; | ||
import dagger.Lazy; | ||
import dagger.MembersInjector; | ||
import javax.inject.Provider; | ||
|
||
@Module | ||
public abstract class FrameworkTypes { | ||
|
||
@<error descr="@Binds methods must not return framework types [Lazy]">Binds</error> | ||
public abstract Lazy lazyReturn(CarImpl car); | ||
|
||
@<error descr="@Binds methods must not return framework types [Lazy]">Binds</error> | ||
public abstract Lazy<?> lazyWildReturn(CarImpl car); | ||
|
||
@<error descr="@Binds methods must not return framework types [Lazy]">Binds</error> | ||
public abstract Lazy<Car> lazyWrappedReturn(CarImpl car); | ||
|
||
@<error descr="@Binds methods must not return framework types [Provider]">Binds</error> | ||
public abstract Provider providerReturn(CarImpl car); | ||
|
||
@<error descr="@Binds methods must not return framework types [Provider]">Binds</error> | ||
public abstract Provider<?> providerWildReturn(CarImpl car); | ||
|
||
@<error descr="@Binds methods must not return framework types [Provider]">Binds</error> | ||
public abstract Provider<Car> providerWrappedReturn(CarImpl car); | ||
|
||
@<error descr="@Binds methods must not return framework types [MembersInjector]">Binds</error> | ||
public abstract MembersInjector membersInjectorReturn(CarImpl car); | ||
|
||
@<error descr="@Binds methods must not return framework types [MembersInjector]">Binds</error> | ||
public abstract MembersInjector<?> membersInjectorWildReturn(CarImpl car); | ||
|
||
@<error descr="@Binds methods must not return framework types [MembersInjector]">Binds</error> | ||
public abstract MembersInjector<Car> membersInjectorWrappedReturn(CarImpl car); | ||
} |
31 changes: 31 additions & 0 deletions
31
src/test/testData/binds/FrameworkTypeReturn/KFailureComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import javax.inject.Inject | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.Binds | ||
import assets.Car | ||
import assets.CarImpl | ||
import dagger.Lazy | ||
import dagger.MembersInjector | ||
import javax.inject.Provider | ||
|
||
@Module | ||
abstract class KFrameworkTypes { | ||
|
||
@<error descr="@Binds methods must not return framework types [Lazy]">Binds</error> | ||
abstract fun lazyWildReturn(car: CarImpl): Lazy<*> | ||
|
||
@<error descr="@Binds methods must not return framework types [Lazy]">Binds</error> | ||
abstract fun lazyWrappedReturn(car: CarImpl): Lazy<Car> | ||
|
||
@<error descr="@Binds methods must not return framework types [Provider]">Binds</error> | ||
abstract fun providerWildReturn(car: CarImpl): Provider<*> | ||
|
||
@<error descr="@Binds methods must not return framework types [Provider]">Binds</error> | ||
abstract fun providerWrappedReturn(car: CarImpl): Provider<Car> | ||
|
||
@<error descr="@Binds methods must not return framework types [MembersInjector]">Binds</error> | ||
abstract fun membersInjectorWildReturn(car: CarImpl): MembersInjector<*> | ||
|
||
@<error descr="@Binds methods must not return framework types [MembersInjector]">Binds</error> | ||
abstract fun membersInjectorWrappedReturn(car: CarImpl): MembersInjector<Car> | ||
} |
31 changes: 31 additions & 0 deletions
31
src/test/testData/binds/FrameworkTypeReturn/KSuccessComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import javax.inject.Inject | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.Binds | ||
import assets.Car | ||
import assets.CarImpl | ||
import dagger.Lazy | ||
import dagger.MembersInjector | ||
import javax.inject.Provider | ||
|
||
@Module | ||
abstract class KWrappedFrameworkTypes { | ||
|
||
@Binds | ||
abstract fun lazyWildReturn(car: CarImpl): Set<Lazy<*>> | ||
|
||
@Binds | ||
abstract fun lazyWrappedReturn(car: CarImpl): Set<Lazy<Car>> | ||
|
||
@Binds | ||
abstract fun providerWildReturn(car: CarImpl): Set<Provider<*>> | ||
|
||
@Binds | ||
abstract fun providerWrappedReturn(car: CarImpl): Set<Provider<Car>> | ||
|
||
@Binds | ||
abstract fun membersInjectorWildReturn(car: CarImpl): Set<MembersInjector<*>> | ||
|
||
@Binds | ||
abstract fun membersInjectorWrappedReturn(car: CarImpl): Set<MembersInjector<Car>> | ||
} |
41 changes: 41 additions & 0 deletions
41
src/test/testData/binds/FrameworkTypeReturn/WrappedFrameworkTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import javax.inject.Inject; | ||
import dagger.Module; | ||
import dagger.Provides; | ||
import dagger.Binds; | ||
import assets.Car; | ||
import assets.CarImpl; | ||
import dagger.Lazy; | ||
import dagger.MembersInjector; | ||
import javax.inject.Provider; | ||
import java.util.Set; | ||
|
||
@Module | ||
public abstract class WrappedFrameworkTypes { | ||
|
||
@Binds | ||
public abstract Set<Lazy> lazyReturn(CarImpl car); | ||
|
||
@Binds | ||
public abstract Set<Lazy<?>> lazyWildReturn(CarImpl car); | ||
|
||
@Binds | ||
public abstract Set<Lazy<Car>> lazyWrappedReturn(CarImpl car); | ||
|
||
@Binds | ||
public abstract Set<Provider> providerReturn(CarImpl car); | ||
|
||
@Binds | ||
public abstract Set<Provider<?>> providerWildReturn(CarImpl car); | ||
|
||
@Binds | ||
public abstract Set<Provider<Car>> providerWrappedReturn(CarImpl car); | ||
|
||
@Binds | ||
public abstract Set<MembersInjector> membersInjectorReturn(CarImpl car); | ||
|
||
@Binds | ||
public abstract Set<MembersInjector<?>> membersInjectorWildReturn(CarImpl car); | ||
|
||
@Binds | ||
public abstract Set<MembersInjector<Car>> membersInjectorWrappedReturn(CarImpl car); | ||
} |