ballerina-lang
ballerina-lang copied to clipboard
[Improvement]: Support distinct error in error semtype integration
Description
$subject.
// distinctId must be >= 0
public function errorDistinct(int distinctId) returns SemType {
BddNode bdd = bddAtom(-distinctId - 1);
return basicSubtype(BT_ERROR, bdd);
}
-
distinct error<R>
is equivalent todistinct error & error<R>
. -
distinct error<R>
semtype can be modeled asCore.intersect(errorDistinct(id), err)
whereerr
is the semtype oferror<R>
.