From 6e01b6b29d11370dee73b01993bd3b85294b5868 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Mena Date: Tue, 4 Jun 2024 14:10:11 +0200 Subject: [PATCH] Add test for #3441 --- .../kotlin/arrow/optics/plugin/DSLTests.kt | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/arrow-libs/optics/arrow-optics-ksp-plugin/src/test/kotlin/arrow/optics/plugin/DSLTests.kt b/arrow-libs/optics/arrow-optics-ksp-plugin/src/test/kotlin/arrow/optics/plugin/DSLTests.kt index 4aaf37178c4..844ae0f2e07 100755 --- a/arrow-libs/optics/arrow-optics-ksp-plugin/src/test/kotlin/arrow/optics/plugin/DSLTests.kt +++ b/arrow-libs/optics/arrow-optics-ksp-plugin/src/test/kotlin/arrow/optics/plugin/DSLTests.kt @@ -112,6 +112,28 @@ class DSLTests { """.compilationSucceeds() } + @Test + fun `DSL for a class in a package including it, issue #3441`() { + """ + |package it.facile.assicurati + | + |$imports + | + |@optics + |data class Source(val models: String) { + | companion object + |} + | + |@optics + |sealed class PrismSealed(val field: String, val nullable: String?) { + | data class PrismSealed1(private val a: String?) : PrismSealed("", a) + | data class PrismSealed2(private val b: String?) : PrismSealed("", b) + | companion object + |} + | + """.compilationSucceeds() + } + @Test fun `DSL works with variance, issue #3057`() { """ @@ -173,6 +195,4 @@ class DSLTests { |} """.compilationSucceeds() } - - // Db.content.at(At.map(), One).set(db, None) }