Comments (6)
The BDD for diff(M1, M2)
is as follows.
- For the failing cases,
(map<any> & map<any> & !map<anydata>) | (!map<any> & map<anydata> & !map<any> & !map<anydata>)
= (map<any> & !map<anydata>) | (map<anydata> & !map<any>)
= map<any> & !map<anydata> | never
= not empty
- For the passing cases,
The tree is same withmap<any>
andmap<anydata>
types interchanged.
(map<anydata> & map<anydata> & !map<any>) | (!map<anydata> & map<any> & !map<anydata> & !map<any>)
= (map<anydata> & !map<any>) | (map<any> & !map<any>)
= never | never
= empty
from ballerina-lang.
Checked in nBallerina, there the diff(M1,M2)
always be never
. In our case, BDDs of M1
and M2
are not identical in terms of the indexes. (We have two map<any>
/map<anydata>
atoms with different indexes) However, in nBallerina we have identical BDDs (Same index for all map<any>
/map<anydata>
) thus the diff()
results in never
.
from ballerina-lang.
Overriding MappingAtomicType
and ComplexSemType
s' equals()
and hashCode()
solved the issue for the original sample. However the following still fails as deep equality is not considered in subtypeDataList
.
type M map<(1|2|3)>;
type N map<(1|2|3)>;
// @type M1 = M2
type M1 M|map<(1|2)>;
type M2 N|map<(1|2)>;
from ballerina-lang.
I was able to reproduce the same scenario(for the original sample) in nBallerina by modifying mappingAtom()
as follows.
isolated function mappingAtom(MappingAtomicType atomicType) returns TypeAtom {
lock {
TypeAtom? ta = self.atomTable[atomicType];
if ta != () {
TypeAtom result = { index: self.atomTable.length(), atomicType };
return result;
}
else {
TypeAtom result = { index: self.atomTable.length(), atomicType };
self.atomTable.add(result);
return result;
}
}
}
The BDD for diff(M1,M2)
I get there is different and it resulted in the correct emptiness. So there is a bug in diff()
in jBallerina.
from ballerina-lang.
The root cause was found to be a bug in mappingInhabited()
when porting. Both nBallerina and jBallerina produce the same BDDs. The previous BDD explained here turned out to be a mistake.
from ballerina-lang.
Fixed in PR #42791
from ballerina-lang.
Related Issues (20)
- [Task]: Fix failing integration tests for Java 21 migration
- [Task]: Implement Java 21 Virtual threads based Runtime Concurrency model
- [Improvement]: Properly distinguish between type descriptor and type in runtime HOT 1
- [Bug]: Getting `missing single backtick token` warning for the doc comment containing backticks
- Lang artifacts are not publishing to the local Maven repository in PR builds HOT 1
- [Bug]: Getting NPE when accessing a field with a default value which is generated from rest binding with the optional field HOT 3
- [Bug]: Regular expression with `toJson` method panics HOT 1
- [Bug]: Compiler crash in a nested query with innermost query having inline record definition with default value
- [Bug]: The compiler crashes when a variable is passed dynamically to a TCP connection service initializer
- [Task]: Publish traces to DataDog
- [Bug]: Intermittent test failures in the daily full build pipeline HOT 1
- [Bug]: decimal:fromString() panics HOT 1
- [Bug]: Update document code action not available for undocumented parameter and return value
- [Bug]: Re-enable the LS test cases that are failing intermittently
- [Bug]: Re-enable jBallerina test cases that are failing intermittently
- [Improvement]: Add jetbrains annotations to the classpath dependencies for `@NotNull` and `@Nullable` annotations HOT 1
- [Task]: Anaylze the vs-code slowness in a multi project scenario HOT 1
- [Bug]: invalid remote method call: expected a client object, but found 'ballerina/http:2.12.0:Client' HOT 3
- [Task]: Add more performance test scenarios
- [Bug]: Incorrect Formatting for Hierarchical Fields
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ballerina-lang.