-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
integration-tests/common-test/src/test/kotlin/me/tatarka/inject/test/TypeAliasTest.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,29 @@ | ||
package me.tatarka.inject.test | ||
|
||
import assertk.assertThat | ||
import assertk.assertions.isNotNull | ||
import kotlin.test.Test | ||
|
||
class TypeAliasTest { | ||
|
||
@Test | ||
fun can_generate_for_typealias_on_typealias_function() { | ||
val component = TypeAliasesComponent::class.create() | ||
|
||
assertThat(component.typeAliasFoo()).isNotNull() | ||
} | ||
|
||
@Test | ||
fun can_generate_for_typealias_on_typealias_to_typealias_function() { | ||
val component = TypeAliasesComponent::class.create() | ||
|
||
assertThat(component.typeAliasToTypeAliasFoo()).isNotNull() | ||
} | ||
|
||
@Test | ||
fun can_generate_for_typealias_on_typealias_to_typealias_to_typealias_function() { | ||
val component = TypeAliasesComponent::class.create() | ||
|
||
assertThat(component.typeAliasToTypeAliasToTypeAliasFoo()).isNotNull() | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
integration-tests/common/src/main/kotlin/me/tatarka/inject/test/TypeAlias.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,28 @@ | ||
package me.tatarka.inject.test | ||
|
||
import me.tatarka.inject.annotations.Component | ||
import me.tatarka.inject.annotations.Inject | ||
|
||
@Inject | ||
class TypeAliasBar | ||
|
||
typealias TypeAliasToTypeAliasBar = TypeAliasBar | ||
typealias TypeAliasToTypeAliasToTypeAliasBar = TypeAliasToTypeAliasBar | ||
|
||
@Inject | ||
fun TypeAliasFoo( | ||
bar: TypeAliasBar, | ||
typeAliasToBar: TypeAliasToTypeAliasBar, | ||
typeAliasToTypeAliasToBar: TypeAliasToTypeAliasToTypeAliasBar, | ||
) {} | ||
typealias TypeAliasFoo = () -> Unit | ||
|
||
typealias TypeAliasToTypeAliasFoo = TypeAliasFoo | ||
typealias TypeAliasToTypeAliasToTypeAliasFoo = TypeAliasToTypeAliasFoo | ||
|
||
@Component | ||
abstract class TypeAliasesComponent { | ||
abstract fun typeAliasFoo(): TypeAliasFoo | ||
abstract fun typeAliasToTypeAliasFoo(): TypeAliasToTypeAliasFoo | ||
abstract fun typeAliasToTypeAliasToTypeAliasFoo(): TypeAliasToTypeAliasToTypeAliasFoo | ||
} |
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
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