Skip to content
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

Allow using interface-converted type-requirement in fields #6341

Merged
merged 8 commits into from
Aug 21, 2024

Conversation

SupunS
Copy link
Member

@SupunS SupunS commented Aug 14, 2024

Closes onflow/cadence#3527

(Solves https://flow-foundation.slack.com/archives/C074F78ECNL/p1723566139471899)

If a type-requirement has been converted to an interface, then allow using such updated type in field. i.e: allow changing the field types to the interface type. Here only T would become {T}, and nothing else would be allowed.

@SupunS SupunS self-assigned this Aug 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 84.33735% with 26 lines in your changes missing coverage. Please review.

Project coverage is 41.51%. Comparing base (3bd915b) to head (aa2515d).

Files Patch % Lines
...l/ledger/migrations/type_requirements_extractor.go 69.23% 15 Missing and 1 partial ⚠️
...l/ledger/migrations/contract_checking_migration.go 79.54% 5 Missing and 4 partials ⚠️
...md/util/ledger/migrations/static_type_migration.go 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6341      +/-   ##
==========================================
+ Coverage   41.46%   41.51%   +0.04%     
==========================================
  Files        2011     2012       +1     
  Lines      143338   143437      +99     
==========================================
+ Hits        59439    59544     +105     
+ Misses      77729    77720       -9     
- Partials     6170     6173       +3     
Flag Coverage Δ
unittests 41.51% <84.33%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SupunS SupunS marked this pull request as ready for review August 14, 2024 21:33
@SupunS SupunS requested review from a team August 14, 2024 21:33
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

cmd/util/ledger/migrations/cadence.go Outdated Show resolved Hide resolved
@SupunS SupunS changed the title Support a white list for type-requirement removals Allow using interface-converted type-requirement in fields Aug 19, 2024
@SupunS
Copy link
Member Author

SupunS commented Aug 19, 2024

Need to add some reporting + more tests

@SupunS SupunS requested a review from turbolent August 20, 2024 18:32
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work generalizing this! 👏

Copy link
Contributor

@janezpodhostnik janezpodhostnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I'm also wondering if we can join the TypeRequirementsExtractingMigration with an existing migration

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@SupunS SupunS force-pushed the supun/type-requirement-removal branch from d0ce4fc to 6736db4 Compare August 21, 2024 17:02
@SupunS SupunS requested a review from turbolent August 21, 2024 17:05
@SupunS SupunS force-pushed the supun/type-requirement-removal branch from 6736db4 to aa2515d Compare August 21, 2024 17:53
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@turbolent turbolent added this pull request to the merge queue Aug 21, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 21, 2024
@SupunS SupunS added this pull request to the merge queue Aug 21, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 21, 2024
@SupunS SupunS added this pull request to the merge queue Aug 21, 2024
Merged via the queue into master with commit 5ffe36f Aug 21, 2024
55 checks passed
@SupunS SupunS deleted the supun/type-requirement-removal branch August 21, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use interface-converted type-requirements in fields
4 participants