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

Introduce indirect error constructors #16244

Merged

Conversation

rdhananjaya
Copy link
Member

@rdhananjaya rdhananjaya commented Jul 4, 2019

Purpose

Allow creating error values using Error type name

var e0 = UserDefError(detail1="arg");
UserDefError e1 = UserDefError(detail1="arg");

Error reason is inferred from the provided error type.

Fixes ballerina-platform/ballerina-spec#223

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
  • Required Balo version update
  • 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

@codecov-io
Copy link

codecov-io commented Jul 4, 2019

Codecov Report

Merging #16244 into master will increase coverage by 1.63%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #16244      +/-   ##
============================================
+ Coverage     11.25%   12.89%   +1.63%     
  Complexity     2969     2969              
============================================
  Files          1500     1495       -5     
  Lines         82798    72287   -10511     
  Branches       9696     8705     -991     
============================================
  Hits           9318     9318              
+ Misses        72555    62044   -10511     
  Partials        925      925
Impacted Files Coverage Δ Complexity Δ
.../compiler/semantics/analyzer/SemanticAnalyzer.java 0% <ø> (ø) 0 <0> (ø) ⬇️
.../ballerinalang/util/diagnostic/DiagnosticCode.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...alang/compiler/semantics/analyzer/TypeChecker.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ler/parser/antlr4/BallerinaParserBaseListener.java
...er/parser/antlr4/BallerinaParserErrorStrategy.java
...nalang/compiler/parser/antlr4/BallerinaParser.java
...inalang/compiler/parser/antlr4/BallerinaLexer.java
...er/parser/antlr4/BallerinaParserErrorListener.java

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e26e597...b7543d9. Read the comment docs.

@rdhananjaya rdhananjaya changed the title [WIP] Introduce indirect error constructors Introduce indirect error constructors Jul 5, 2019
@rdhananjaya rdhananjaya marked this pull request as ready for review July 5, 2019 07:22
…lang into indirect-error-ctor-exprs

# Conflicts:
#	compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java
#	compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangParserListener.java
@rdhananjaya rdhananjaya changed the base branch from jballerina to master July 6, 2019 13:53
… into indirect-error-ctor-exprs

# Conflicts:
#	compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.java
@rdhananjaya rdhananjaya force-pushed the indirect-error-ctor-exprs branch from ec1a63e to aee3c84 Compare July 9, 2019 04:15
@hasithaa hasithaa merged commit 9a99645 into ballerina-platform:master Jul 11, 2019
@rdhananjaya rdhananjaya deleted the indirect-error-ctor-exprs branch September 11, 2019 03:00
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.

Allow error constructors to use named error type
3 participants