dimsuz
12/06/2022, 5:55 PM@RequiresTypeResolution
to the rule class
• In my test (using KoTest
) I have called createEnvironment()
• Then I switched to MyRule().compileAndLintWithContext(env, code)
All existing tests keep passing (so no errors in test/env setup).
But the following code:
fun visitNamedFunction(function: KtNamedFunction) {
println(bindingContext.getType(function))
}
prints "*null*".
I have also checked that bindingContext == BindingContext.EMPTY
returns false.
Did I miss someting?dimsuz
12/06/2022, 6:01 PMbindingContext.diagnostics.forEach {
println(it.factoryName)
}
prints:
UNRESOLVED_REFERENCE
UNRESOLVED_REFERENCE
UNRESOLVED_REFERENCE
UNRESOLVED_REFERENCE
UNRESOLVED_REFERENCE
UNRESOLVED_REFERENCE
UNRESOLVED_REFERENCE
UNRESOLVED_REFERENCE
UNUSED_PARAMETER
Looks like my sample test code is not set up for compiling 🙂dimsuz
12/06/2022, 6:04 PM@Composable
and Modifier
and all that. There's additionalRootPaths
parameters, but not sure what to feed there for Compose
. Investigating.Brais Gabin
12/07/2022, 11:39 AM./gradlew test -Pcompile-test-snippets=true
? I'm guessing here but probably you need to add compose as a testImplementation
dependency the gradle module.dimsuz
12/07/2022, 8:50 PM