Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dulajdilshan committed Jun 24, 2024
1 parent 6420b3e commit db0b569
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5685,8 +5685,9 @@ private BErrorType createErrorType(BType lhsType, BType rhsType, BType detailTyp
BErrorType lhsErrorType = (BErrorType) lhsType;
BErrorType rhsErrorType = (BErrorType) rhsType;

BErrorType errorType = createErrorType(detailType, lhsType.flags, env);
errorType.tsymbol.flags |= rhsType.flags;
long flags = lhsType.flags | rhsType.flags | Flags.PUBLIC; // Anonymous error intersection types must be public

BErrorType errorType = createErrorType(detailType, flags, env);

errorType.typeIdSet = BTypeIdSet.getIntersection(lhsErrorType.typeIdSet, rhsErrorType.typeIdSet);

Expand All @@ -5695,8 +5696,7 @@ private BErrorType createErrorType(BType lhsType, BType rhsType, BType detailTyp

public BErrorType createErrorType(BType detailType, long flags, SymbolEnv env) {
String name = anonymousModelHelper.getNextAnonymousIntersectionErrorTypeName(env.enclPkg.packageID);
BErrorTypeSymbol errorTypeSymbol = Symbols.createErrorSymbol(flags | Flags.ANONYMOUS | Flags.PUBLIC,
Names.fromString(name),
BErrorTypeSymbol errorTypeSymbol = Symbols.createErrorSymbol(flags | Flags.ANONYMOUS, Names.fromString(name),
env.enclPkg.symbol.pkgID, null,
env.scope.owner, symTable.builtinPos, VIRTUAL);
errorTypeSymbol.scope = new Scope(errorTypeSymbol);
Expand Down

0 comments on commit db0b569

Please sign in to comment.