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

Add support for error binding patterns in the on fail clause #41049

Merged
merged 56 commits into from
Nov 23, 2023

Conversation

MaryamZi
Copy link
Member

@MaryamZi MaryamZi commented Jul 18, 2023

Purpose

$title.

import ballerina/io;

public function main() {
    do {
        fail error("error!");
    } on fail var error(m) {
        io:println("Error: ", m);
    }
}

Fixes #29183

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

suleka96 and others added 28 commits April 13, 2023 05:04
Add parser changes for Error BP support for `on fail` clause
Add compiler changes for enabling Error BP in `on fail` clause
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

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

Comparison is base (21a32d4) 76.73% compared to head (a99b983) 76.73%.
Report is 96 commits behind head on master.

Files Patch % Lines
...in/java/io/ballerina/projects/DependencyGraph.java 0.00% 24 Missing ⚠️
...io/ballerina/compiler/syntax/tree/NodeFactory.java 25.00% 3 Missing ⚠️
...allerinalang/compiler/bir/codegen/JvmValueGen.java 95.55% 1 Missing and 1 partial ⚠️
...lang/compiler/semantics/analyzer/CodeAnalyzer.java 84.61% 0 Missing and 2 partials ⚠️
...llerinalang/compiler/semantics/analyzer/Types.java 90.90% 1 Missing and 1 partial ⚠️
...o/ballerina/compiler/syntax/tree/TreeModifier.java 0.00% 2 Missing ⚠️
...ompiler/bir/codegen/interop/ExternalMethodGen.java 83.33% 0 Missing and 1 partial ⚠️
...lang/compiler/bir/codegen/methodgen/MethodGen.java 98.18% 0 Missing and 1 partial ⚠️
.../compiler/semantics/analyzer/SemanticAnalyzer.java 98.63% 0 Missing and 1 partial ⚠️
.../compiler/internal/parser/tree/STTreeModifier.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #41049   +/-   ##
=========================================
  Coverage     76.73%   76.73%           
- Complexity    52692    52715   +23     
=========================================
  Files          2879     2878    -1     
  Lines        198658   198706   +48     
  Branches      25809    25825   +16     
=========================================
+ Hits         152434   152475   +41     
- Misses        37797    37804    +7     
  Partials       8427     8427           

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

@github-actions
Copy link

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 Sep 28, 2023
@MaryamZi MaryamZi removed the Stale label Sep 29, 2023
@MaryamZi MaryamZi requested a review from gimantha November 2, 2023 08:23
gimantha
gimantha previously approved these changes Nov 2, 2023
Copy link
Contributor

@gimantha gimantha left a comment

Choose a reason for hiding this comment

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

LGTM

dulajdilshan
dulajdilshan previously approved these changes Nov 16, 2023
Copy link
Contributor

@dulajdilshan dulajdilshan left a comment

Choose a reason for hiding this comment

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

LGTM

@MaryamZi MaryamZi dismissed stale reviews from dulajdilshan and gimantha via bbbbf35 November 17, 2023 09:54
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 11 Code Smells

0.0% 0.0% Coverage
0.2% 0.2% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@MaryamZi MaryamZi merged commit a33bee3 into master Nov 23, 2023
17 of 18 checks passed
@MaryamZi MaryamZi deleted the on-fail-error-bp branch November 23, 2023 09:02
@MaryamZi MaryamZi added this to the 2201.9.0 milestone Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Cannot use an error binding pattern in the on-fail-clause
7 participants