bloder
01/04/2022, 6:39 PMval list = listOf(1)
data class FilledList private constructor(val value: List<Int>) {
companion object : Refined<List<Int>, FilledList>(::FilledList, { ensure((it.isNotEmpty()) to "list cannot be empty") })
}
val filledList = FilledList(list)
And is popping:
val list = listOf(1) can't be verified at compile time. Use `Predicate.orNull(val list = listOf(1))` for safe access or `Predicate.require(val list = listOf(1))` for explicit unsafe instantiation
If I remove this list reference from the property and put its instance directly on FilledList invoke call site (FilledList(listOf())
), nothing happens and its refinement occurs in runtime. I'm missing something or is not supported? If is not supported is there a typeclass / applicative or something that I can integrate with collections to make it work?raulraja
01/04/2022, 8:46 PMraulraja
01/04/2022, 8:47 PMraulraja
01/04/2022, 8:48 PMbloder
01/04/2022, 10:53 PMraulraja
01/04/2022, 11:00 PMraulraja
01/04/2022, 11:03 PMraulraja
01/04/2022, 11:03 PMbloder
01/04/2022, 11:15 PMbloder
01/04/2022, 11:29 PMA problem occurred evaluating project ':app'.
> org/gradle/util/internal/VersionNumber
Did u already face that problem?bloder
01/04/2022, 11:32 PMUnable to load class 'org.gradle.util.internal.VersionNumber'.
bloder
01/04/2022, 11:33 PMraulraja
01/05/2022, 12:01 AMbloder
01/05/2022, 1:38 AMOlivier Laforest
01/06/2022, 10:04 PMraulraja
01/06/2022, 10:37 PM