Jonathan Lindegaard Starup
Jonathan Lindegaard Starup
OptionalInt doesnt inherit/implement anything. I don't this function can exist 🤔 At least not in an injective way since both `Int32` and `java.lang.integer` would be mapped to the same type...
@magnus-madsen @mlutze actually most things in adapter has this bug. maybe we should do something with boxing and a helper function or something
That would fix it (until we have generics on java types like `ArrayList[t]`)
Another fix could be to add `t1 !~ t2` constraints where either t1 or t2 must be ground, but that sounds more like a paper than a quick fix
I just think its very error prone, since you manually have to remember it. But I'm also not sure since this is not used anywhere, so its hard to know...
If was imagining that i want to use some `Option[t] -> Option[t]` java function, so `Optional -> Optional`. If I then want to wrap it in a flix option then...
I think we could explore checking casts after monomorphization
In a world with java generics (i.e. `java.lang.Optional[t]`) the typematch+box version of the function can't be typed
@mlutze could a constraint like `_ !~ Int32` be okay because the rhs is simple and ground? Maybe we could allow `a not primitive` as a constraint I guess its...
Yeah ill give it a full look over and ping you