-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert references based on borrow type #3213
Convert references based on borrow type #3213
Conversation
020d36a
to
0077f05
Compare
@SupunS Could you please add a description of what the PR does and why? I tried to have a look at the PR, but I don't quite see what the changes are and why they're needed (what the problem is). Thank you! |
@turbolent #3213 (comment) has a description on the change. I put it as a comment, because then it is easier to point to where the actual fix is. I'll copy this over to the description as well. |
Updated the description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It somewhat makes sense to me what was done before and how it needs to be adjusted for Cadence 1.0 👍
The TODO/Skip is left because we still need to investigate why the test fails, but still want to unblock #3079 and get that in before?
Yes. I already figured out the cause, but needed to figure out a solution. It probably needs some extra work, so don't want to block the remaining fixes until we figure that one out. |
Work towards #3081
Description
In Cadence
v0.42
, thevalueType
(which is aReferenceStaticType
) included not only the referenced-type, but also the "borrowed type" of the value. So if the borrowed-type/referenced-type was different than the expected-type, then the conversion happened. This was added in https://github.com/dapperlabs/cadence-internal/pull/201.However, in Cadence
1.0
, the theReferenceStaticType
(and thereforevalueType
) no longer contains the borrow-type. So even if the borrowed-type was different, the existing check would see thevalueType
and theexpectedType
as equal, and the conversion wouldn't happen. So this change here is to also consider the borrowed-type, just like it used to, but now the borrow-type has to be taken from theReferenceValue
, becauseReferenceStaticType
no longer has it.The actual fix is #3213 (comment).
master
branchFiles changed
in the Github PR explorer