-
Notifications
You must be signed in to change notification settings - Fork 736
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
Fix dependently-typed functions with type reference union member types #43017
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #43017 +/- ##
============================================
- Coverage 77.68% 77.68% -0.01%
+ Complexity 51481 51480 -1
============================================
Files 2933 2933
Lines 204239 204244 +5
Branches 26720 26721 +1
============================================
+ Hits 158666 158667 +1
- Misses 36948 36951 +3
- Partials 8625 8626 +1 ☔ View full report in Codecov by Sentry. |
compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/Unifier.java
Outdated
Show resolved
Hide resolved
...t-test/src/test/resources/test-src/javainterop/dependently_typed_functions_test_negative.bal
Show resolved
Hide resolved
@@ -986,7 +986,8 @@ private BType getMatchingTypeForInferrableType(BType originalType, BType expType | |||
|
|||
for (BType inferableType : inferableTypes) { | |||
for (BType expectedType : expectedTypes) { | |||
if (Types.getImpliedType(inferableType).tag == Types.getImpliedType(expectedType).tag) { | |||
expectedType = Types.getImpliedType(expectedType); | |||
if (Types.getImpliedType(inferableType).tag == expectedType.tag) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? When creating the inferableTypes
and expectedTypes
lists, don't we need to add the original types(by doing the getImpliedType
when creating the lists)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering the same. But we seem to have worked with implied types even in the non-union case, so decided to do the same in the union case also.
Purpose
$title.
Fixes #43012
Check List