Skip to content

Commit

Permalink
Add tsymbol
Browse files Browse the repository at this point in the history
  • Loading branch information
poorna2152 committed Oct 18, 2024
1 parent df03dac commit 331d30b
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ public Types(CompilerContext context) {
this.symResolver = SymbolResolver.getInstance(context);
this.dlog = BLangDiagnosticLog.getInstance(context);
this.names = Names.getInstance(context);
this.expandedXMLBuiltinSubtypes = BUnionType.create(null,
symTable.xmlElementType, symTable.xmlCommentType,
symTable.xmlPIType, symTable.xmlTextType);
this.unifier = new Unifier();
this.anonymousModelHelper = BLangAnonymousModelHelper.getInstance(context);
}
Expand Down Expand Up @@ -2053,10 +2050,14 @@ private BType getTypedBindingPatternTypeForXmlCollection(BType collectionType) {
case TypeTags.NEVER:
return constraint;
case TypeTags.UNION:
BTypeSymbol collectionTSymbol = collectionType.tsymbol;
BTypeSymbol typeSymbol =
Symbols.createTypeSymbol(SymTag.UNION_TYPE, Flags.asMask(EnumSet.of(Flag.PUBLIC)), Names.EMPTY,
collectionTSymbol.pkgID, null, collectionTSymbol.owner, symTable.builtinPos, VIRTUAL);
Set<BType> collectionTypes = getEffectiveMemberTypes((BUnionType) constraint);
Set<BType> builtinXMLConstraintTypes = getEffectiveMemberTypes
((BUnionType) ((BXMLType) symTable.xmlType).constraint);
return BUnionType.create(null, (LinkedHashSet<BType>) collectionTypes);
BType type = BUnionType.create(typeSymbol, (LinkedHashSet<BType>) collectionTypes);
typeSymbol.type = type;
return type;
default:
return null;
}
Expand Down

0 comments on commit 331d30b

Please sign in to comment.