-
Notifications
You must be signed in to change notification settings - Fork 755
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
[Master] Fix incorrect results for panic in module-const-declaration
with arithmetic operators
#37726
[Master] Fix incorrect results for panic in module-const-declaration
with arithmetic operators
#37726
Conversation
While we are logging the java errors for constant-expr Line 333 in 68a7396
we stick with the java like error for
which is |
.../src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/ConstantValueResolver.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/ConstantValueResolver.java
Outdated
Show resolved
Hide resolved
IMO, we have to change the error messages since Ballerina has different data types compared to Java. For example, |
...na-unit-test/src/test/resources/test-src/types/constant/simple-literal-constant-negative.bal
Show resolved
Hide resolved
.../src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/ConstantValueResolver.java
Show resolved
Hide resolved
68a7396
to
60870f0
Compare
Updated 60870f0 |
60870f0
to
526aee5
Compare
Codecov ReportBase: 77.69% // Head: 76.28% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #37726 +/- ##
============================================
- Coverage 77.69% 76.28% -1.41%
+ Complexity 67866 53265 -14601
============================================
Files 3543 3406 -137
Lines 256170 200803 -55367
Branches 39947 25886 -14061
============================================
- Hits 199020 153190 -45830
+ Misses 47668 39025 -8643
+ Partials 9482 8588 -894
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
.../src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/ConstantValueResolver.java
Show resolved
Hide resolved
We need to handle overflow scenarios of const decimal X = 1e100000000000000050 * 1e10000000000300050; |
Fixes in #37823 |
@prakanth97 can you please resolve the conflict |
.../src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/ConstantValueResolver.java
Outdated
Show resolved
Hide resolved
@prakanth97 please check on the build |
Build failure is not due to my fix, Now it is resolved in the master |
...r/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java
Show resolved
Hide resolved
...na-unit-test/src/test/resources/test-src/types/constant/simple-literal-constant-negative.bal
Outdated
Show resolved
Hide resolved
...na-unit-test/src/test/resources/test-src/types/constant/simple-literal-constant-negative.bal
Outdated
Show resolved
Hide resolved
I am getting
|
Added check based on this comment https://github.com/ballerina-platform/ballerina-lang/pull/37726/files#r1019873516 It is correct according to the spec https://ballerina.io/spec/lang/master/#section_5.2.4.2 |
@prakanth97 can you check on the pipeline failures |
Purpose
Fixes #36648
Fixes #37711
Approach
Give compile-time errors for panic scenarios instead of giving wrong output.
Samples
Now, these test cases will give compile-time error
Remarks
#13944
Check List