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
Any function that has a with label is skipped during type checking. This means that you don't know if you're generic function is actually sane until you try to call it.
This will be a tricky thing to resolve. Consider the following:
with T
fn generic_putu T do
cast(int) putu
end
Until we can put bounds on T, we can't actually tell if this function is valid. As such, we may need to do something link:
with T
fn generic_putu T do
cast(int) putu
where T -> int bool ptr
end
If there isn't a where clause, then it is assumed that T could be any type.
Multiple bounded generics could be handled with multiple where clauses, but it's kinda ugly. Though syntax really isn't the problem at this point.
with A B
fn foo A B do
// ...
where A -> int bool ptr
where B -> int bool ptr
end
The text was updated successfully, but these errors were encountered:
Any function that has a
with
label is skipped during type checking. This means that you don't know if you're generic function is actually sane until you try to call it.This will be a tricky thing to resolve. Consider the following:
Until we can put bounds on T, we can't actually tell if this function is valid. As such, we may need to do something link:
If there isn't a where clause, then it is assumed that
T
could be any type.Multiple bounded generics could be handled with multiple where clauses, but it's kinda ugly. Though syntax really isn't the problem at this point.
The text was updated successfully, but these errors were encountered: