Thread
#arrow-meta
    Ties

    Ties

    5 months ago
    In doing some experimentation I found something that is not very intuative:
    @JvmInline
    value class String5till10(val value: String) {
    	init {
    		require(value.length >= 5) { "String should be minimal 5 characters" }
    		require(value.length <= 10) { "String should be maximum 10 characters" }
    	}
    }
    
    
    // This works
    val value = getRandomString()
    if (value.length > 6) {
    	if (value.length < 10) {
    		StringExamples.String5till10(value)
    	}
    }
    
    //This does not
    val value = getRandomString()
    if (value.length > 6 && value.length < 10) {
    	StringExamples.String5till10(value)
    }
    Alejandro Serrano Mena

    Alejandro Serrano Mena

    5 months ago
    this is definitely a bug
    I guess the transformation of conditionals into internal constraints is not working as it should with
    &&
    Ties

    Ties

    5 months ago
    Ill make a bug report then 🙂
    Alejandro Serrano Mena

    Alejandro Serrano Mena

    5 months ago
    Ties

    Ties

    5 months ago
    I guess i will not make a bug report then 🙂
    Alejandro Serrano Mena

    Alejandro Serrano Mena

    5 months ago
    new stable version 2.0.2 released with that bugfix!