Closed traceyyoshima closed 6 months ago
Resolved: Blocked by https://github.com/openrewrite/rewrite-kotlin/issues/480.
In J
, switch expressions add the default keyword as an expression too. The else
keyword in a Kotlin when expression is functionally the same. The FindMissingTypes recipe used for TypeValidation has a condition that accepts default
and other case statements with null types. So, a similar condition has been added to validate Kotlin types in the LST.
@knutwannheden type validation is essentially ready for review. The failing tests are identifiers with aliases, and I'm looking into how to detect aliases.
import java.util.regex.Pattern.CASE_INSENSITIVE as i
class A {
val f = arrayOf(i)
}
As we can disable validations on a test case basis, we can fix any remaining issues in follow up PRs.
Disabled the alias tests and opened: https://github.com/openrewrite/rewrite-kotlin/issues/545 to track a fix for aliases. Tracking the declarations of a name will allow us to apply the appropriate field type comparison.
Changes:
fixes https://github.com/openrewrite/rewrite-kotlin/issues/482 fixes https://github.com/openrewrite/rewrite-kotlin/issues/474