ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

[Improvement]: Support distinct error in error semtype integration

Open lochana-chathura opened this issue 7 months ago • 0 comments

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 to distinct error & error<R>.

  • distinct error<R> semtype can be modeled as Core.intersect(errorDistinct(id), err) where err is the semtype of error<R>.

lochana-chathura avatar Jul 03 '24 05:07 lochana-chathura