Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
IVIanuu committed Feb 26, 2024
1 parent a5a0630 commit 1a99194
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,29 +312,29 @@ class ResolutionTest {
invokeSingleFile() shouldBe "nonnull"
}

@Test fun testPrefersUserInjectableErrorOverBuiltInInjectable() = singleAndMultiCodegen(
"""
@Provide fun <T> diyLambda(unit: Unit): () -> T = { TODO() }
""",
"""
fun invoke() = inject<() -> Foo>()
"""
) {
compilationShouldHaveFailed("no injectable")
}

@Test fun testDoesNotPreferValueArgumentOverAnother() = codegen(
"""
@Provide class FooModule {
@Provide fun foo() = Foo()
}
fun createFoo(foo1: Foo = inject, foo2: Foo = inject) = inject<Foo>()
fun createFoo(@Provide foo1: Foo, @Provide foo2: Foo) = inject<Foo>()
"""
) {
compilationShouldHaveFailed("ambiguous")
}

@Test fun testPrefersUserInjectableErrorOverBuiltInInjectable() = singleAndMultiCodegen(
"""
@Provide fun <T> diyLambda(unit: Unit): () -> T = { TODO() }
""",
"""
fun invoke() = inject<() -> Foo>()
"""
) {
compilationShouldHaveFailed("no injectable")
}

@Test fun testCircularDependencyFails() = singleAndMultiCodegen(
"""
@Provide class A(b: B)
Expand Down

0 comments on commit 1a99194

Please sign in to comment.