Type checker failing too early on complex remote calls #358
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: hanssv
Example:
I have looked into this and the reason for why this bug is happening seems to be that the constraints are being solved out of order.
In the above code, there are 2 dependent type constraints (one for
mkCoin()
and the other formint()
), and 1 field constraint (forr.mint()
).To be able to solve the field constraint for
r.mint()
, the dependent type constraint formkCoin()
has to be solved first or otherwise the type of the recordr
will be unknown.Currently, the code tries to solve all field constraints before moving to solve the dependent type constraints here.
What I think would fix this bug is trying to solve the constraints in the order in which they are added (1. dependent type constraint for
mkCoin()
, 2. field constraint forr.mint()
, 3. dependent type constraint forr.mint()
).Do you know of the reason why constraints are being solved separately? and do you think that the above solution might fail for some reason?
Created by: UlfNorell
The proper solution would be to solve all constraints together and be more careful about only failing hard if we know a constraint is unsolvable, and save it for later if more information might allow us to solve it. I don't think there are any reasons why the constraints need to be solved separately.