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

Make checkParameterizedTypeIsInstantiated recursive #2915

Conversation

darkdrag00nv2
Copy link
Contributor

@darkdrag00nv2 darkdrag00nv2 commented Oct 31, 2023

Closes #2884

Description

This PR makes the checker function checkParameterizedTypeIsInstantiated recursive so that a non-instantiated type parameter is caught even if it is inside a container.

See linked issue for more.


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

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.

👍

runtime/sema/checker.go Outdated Show resolved Hide resolved
runtime/sema/checker.go Outdated Show resolved Hide resolved
runtime/tests/checker/typeargument_test.go Outdated Show resolved Hide resolved
runtime/tests/checker/typeargument_test.go Outdated Show resolved Hide resolved
runtime/tests/checker/typeargument_test.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (733cf47) 79.61% compared to head (f82c07f) 79.64%.
Report is 4 commits behind head on feature/range-type.

Files Patch % Lines
runtime/sema/type.go 88.31% 9 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           feature/range-type    #2915      +/-   ##
======================================================
+ Coverage               79.61%   79.64%   +0.02%     
======================================================
  Files                     336      336              
  Lines                   79813    79858      +45     
======================================================
+ Hits                    63547    63600      +53     
+ Misses                  13894    13886       -8     
  Partials                 2372     2372              
Flag Coverage Δ
unittests 79.64% <90.52%> (+0.02%) ⬆️

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.

@darkdrag00nv2
Copy link
Contributor Author

Somehow CI is complaining about data race in tests. Need to check that but the PR can be looked at in the meantime.

Copy link
Member

@SupunS SupunS 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!

runtime/sema/type.go Outdated Show resolved Hide resolved
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! 👏

Once the last test case is added, this is good to go 👍

runtime/sema/type.go Show resolved Hide resolved
@turbolent
Copy link
Member

@dsainati1 Could you please also have a look?

@darkdrag00nv2 darkdrag00nv2 force-pushed the range_type_check_parameterized_type_recursive branch from f25769a to 70e16fa Compare December 8, 2023 15:57
@darkdrag00nv2 darkdrag00nv2 force-pushed the range_type_check_parameterized_type_recursive branch from 70e16fa to 3bd5990 Compare December 8, 2023 15:58
@SupunS SupunS merged commit 2a2c540 into onflow:feature/range-type Dec 11, 2023
6 of 11 checks passed
@darkdrag00nv2 darkdrag00nv2 deleted the range_type_check_parameterized_type_recursive branch December 11, 2023 19:17
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.

3 participants