Merge pull request #3845 from vitorpamplona/claude/explained-filter-test-warnings-clpcv8

Test: Type ExplainedFilter.copy() result as base Filter
This commit is contained in:
Vitor Pamplona
2026-08-01 14:08:56 -04:00
committed by GitHub
@@ -108,7 +108,9 @@ class ExplainedFilterTest {
*/
@Test
fun `copy preserves the purpose`() {
val advanced = explained().copy(since = 1_785_379_272)
// Typed as the base Filter so the is-check below stays a runtime assertion — with the
// override's covariant return type inferred, the compiler would prove it true statically.
val advanced: Filter = explained().copy(since = 1_785_379_272)
assertTrue("copy() must stay an ExplainedFilter", advanced is ExplainedFilter)
assertEquals(SubPurpose.NOTIFICATIONS, advanced.purposeOrNull())