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

Support constant byte array literal #40979

Merged
merged 17 commits into from
Aug 11, 2023

Conversation

ushirask
Copy link
Contributor

Purpose

$title

Fixes #40536
Fixes #37423

Approach

Describe how you are implementing the solutions along with the design details.

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

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • 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

@ushirask ushirask requested a review from prakanth97 July 11, 2023 03:52
@prakanth97
Copy link
Contributor

prakanth97 commented Jul 14, 2023

Since we know the constant value at compile-time, we should support below case

const [170] X = base16 `aa`;

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Patch coverage: 95.45% and project coverage change: +76.39% 🎉

Comparison is base (8a0431e) 0.00% compared to head (a6c2bfb) 76.39%.
Report is 17 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #40979       +/-   ##
=============================================
+ Coverage      0.00%   76.39%   +76.39%     
- Complexity        0    52119    +52119     
=============================================
  Files             9     2858     +2849     
  Lines            35   195968   +195933     
  Branches          0    25401    +25401     
=============================================
+ Hits              0   149717   +149717     
- Misses           35    37952    +37917     
- Partials          0     8299     +8299     
Files Changed Coverage Δ
...llerinalang/compiler/util/ImmutableTypeCloner.java 88.44% <ø> (ø)
...llerinalang/compiler/semantics/analyzer/Types.java 81.76% <50.00%> (ø)
...g/wso2/ballerinalang/compiler/desugar/Desugar.java 90.31% <100.00%> (ø)
...allerinalang/compiler/parser/BLangNodeBuilder.java 94.42% <100.00%> (ø)
...lang/compiler/semantics/analyzer/CodeAnalyzer.java 87.58% <100.00%> (ø)
...mpiler/semantics/analyzer/ConstantTypeChecker.java 67.40% <100.00%> (ø)
...rinalang/compiler/semantics/model/SymbolTable.java 96.55% <100.00%> (ø)

... and 2850 files with indirect coverage changes

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

@github-actions
Copy link

github-actions bot commented Aug 4, 2023

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 github-actions bot added the Stale label Aug 4, 2023
@prakanth97 prakanth97 removed the Stale label Aug 8, 2023
@prakanth97
Copy link
Contributor

prakanth97 commented Aug 9, 2023

Since we know the constant value at compile-time, we should support below case

const [170] X = base16 `aa`;

With this commit this issue could be fixed. Could you pls add those changes?

Copy link
Contributor

@prakanth97 prakanth97 left a comment

Choose a reason for hiding this comment

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

LGTM

@hasithaa hasithaa merged commit 1c72d71 into ballerina-platform:master Aug 11, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement]: Support constant byte array literal CCE when byte-array-literal occurs within a const-expr
3 participants