ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

Fix `BFields` of generated immutable `BRecords` not being marked as `SymbolFlags.READONLY`

Open Thushara-Piyasekara opened this issue 10 months ago • 5 comments

Purpose

Fixes https://github.com/ballerina-platform/ballerina-lang/issues/42520

Approach

After a discussion with @heshanpadmasiri, it was apparent the InherentTypeViolation error for BFields of readonly BRecords were not getting triggered. This was due to the mutable BRecord generation not inheriting the readonly flag to the generated BFields.

After refactoring the logic to make the BFields also inherit the readonly flag, both cases mentioned in https://github.com/ballerina-platform/ballerina-lang/issues/42520 triggered the same error.

Samples

Provide high-level details about the samples related to this feature.

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • [x] Read the Contributing Guide
  • [ ] Updated Change Log
  • [ ] Checked Tooling Support (#<Issue Number>)
  • [ ] Added necessary tests
    • [ ] Unit Tests
    • [ ] Spec Conformance Tests
    • [ ] Integration Tests
    • [ ] Ballerina By Example Tests
  • [ ] Increased Test Coverage
  • [ ] Added necessary documentation
    • [ ] API documentation
    • [ ] Module documentation in Module.md files
    • [ ] Ballerina By Examples

Thushara-Piyasekara avatar Apr 09 '24 12:04 Thushara-Piyasekara

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

github-actions[bot] avatar Apr 26 '24 19:04 github-actions[bot]

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

github-actions[bot] avatar May 22 '24 19:05 github-actions[bot]

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

github-actions[bot] avatar Jun 07 '24 19:06 github-actions[bot]

Closed PR due to inactivity for more than 18 days.

github-actions[bot] avatar Jun 12 '24 19:06 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.35%. Comparing base (4d2abe5) to head (fab7ee8). Report is 6 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #42521      +/-   ##
============================================
+ Coverage     77.34%   77.35%   +0.01%     
- Complexity    58587    58592       +5     
============================================
  Files          3460     3460              
  Lines        219862   219860       -2     
  Branches      28914    28914              
============================================
+ Hits         170055   170077      +22     
+ Misses        40391    40368      -23     
+ Partials       9416     9415       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 24 '24 18:06 codecov[bot]

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

github-actions[bot] avatar Jul 17 '24 19:07 github-actions[bot]

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

github-actions[bot] avatar Aug 05 '24 19:08 github-actions[bot]

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

github-actions[bot] avatar Aug 22 '24 19:08 github-actions[bot]

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

github-actions[bot] avatar Sep 08 '24 19:09 github-actions[bot]