Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[2201.10.x] Desugar field access expression to if statement expression #43776

Open
wants to merge 9 commits into
base: 2201.10.x
Choose a base branch
from

Conversation

rdulmina
Copy link
Contributor

Purpose

$title

Fixes #43769

Approach

Desugared field access expression to the following structure

// Before :
type A {
  B b;
}
type B {
 int c;
}
int? res = a?.b?.c

// After desugar :
any|error temp_result;
temp_result = a;
if temp_result !is error? {
    temp_result = (<A> temp_result).b;
    if temp_result !is error? {
        temp_result = (<B> temp_result).c;
    }
}
int? res = <int> temp_result;
 

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

@rdulmina rdulmina added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label Jan 29, 2025
@rdulmina rdulmina closed this Jan 30, 2025
@rdulmina rdulmina reopened this Jan 30, 2025
@rdulmina rdulmina closed this Jan 30, 2025
@rdulmina rdulmina reopened this Jan 30, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants