trying out the `Arrow-Analysis` … it’s early here ...
# arrow
p
trying out the
Arrow-Analysis
… it’s early here but am i being dense with this error? 😅
Copy code
fun domain(): Option<Domain> {
        val parts = value.split("@") // no pattern matching in kotlin :((((
        return if (parts.size != 2)
            None
        else
            Some(Domain(parts[1]))
    }
Copy code
e: /Users/peter/develop/x.kt: (69, 25): pre-condition `index within bounds` is not satisfied in `parts[1]`
  -> unsatisfiable constraint: `(1 >= 0) && (1 < (parts.size))`
  -> 
`1` bound to param `index` in `kotlin.collections.List.get` 
  -> in branch: value != null, !(parts.size != 2), cond50, parts != null
e: /Users/peter/develop/x.kt: (69, 25): pre-condition `index within bounds` is not satisfied in `parts[1]`
  -> unsatisfiable constraint: `(1 >= 0) && (1 < (parts.size))`
  -> 
`1` bound to param `index` in `kotlin.collections.List.get` 
  -> in branch: value != null, !(parts.size != 2), cond50, parts != null, Domain != null, parts != null
doesn’t
!(parts.size != 2)
prove parts.size == 2? 🤔
a
indeed, that should be the case…
could you report it in the repo so we don’t lose track?
p
sure thing
a
these are the kind of bugs which are fun to debug 🙂
🙂 2
p
i bet 😅
a
it was fun at the end: it turns out that at the point in which we run the analysis the type inference process is not 100% finished, so it was thinking that
parts.size == 2
was using
Any.equals
. That method does not introduce any additional information, so negating it was adding nothing either. I’m working on a fix, I hope the snapshot to be available soon.
🙌 2