You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a minified version of a boxing[?]-related issue arising in #561:
record IntSet(eq: (Int, Int) =>Bool at {})
defget(s: IntSet, k: Int) = {
s.eq(k, 0) match {
//~^~~~~~~~~// ^ Wrong number of value arguments, given 3, but eq expects 1.casetrue=><>casefalse=><>
}
}
if (idx > 0 and (heap.cmp)(arr.unsafeGet(parent(idx)), arr.unsafeGet(idx)) is Greater()) {
ANF-ing the s.eq(k, 0) like this:
valzero?= s.eq(k, 0)
zero?match { ... }
doesn't work either, not even if I annotate the new binding with : Bool.
Of course, one can:
explicitly unbox: (unbox s.eq)(k, 0), but that's not exactly pretty
unpack the s: val Set(eq) = s; eq(k, 0) match { ... }, but I don't like it either... :/
wrap in parens: (s.eq)(k, 0), thanks to @marzipankaiser for the mention :)
However, I'd really like to write it directly: is there a way to see through this layer of indirection?
Or could we at least have a nicer error message here saying "try unpacking by hand"?
The text was updated successfully, but these errors were encountered:
This is a minified version of a boxing[?]-related issue arising in #561:
The actual failing example
Interestingly enough, something similar seems to work perfectly fine in the heap example in #585:
effekt/libraries/common/heap.effekt
Line 26 in 72702b3
ANF-ing the
s.eq(k, 0)
like this:doesn't work either, not even if I annotate the new binding with
: Bool
.Of course, one can:
(unbox s.eq)(k, 0)
, but that's not exactly prettys
:val Set(eq) = s; eq(k, 0) match { ... }
, but I don't like it either... :/(s.eq)(k, 0)
, thanks to @marzipankaiser for the mention :)However, I'd really like to write it directly: is there a way to see through this layer of indirection?
Or could we at least have a nicer error message here saying "try unpacking by hand"?
The text was updated successfully, but these errors were encountered: