Skip to content

Commit

Permalink
Address suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilhasha committed Jan 5, 2024
1 parent 437cbc0 commit 75df9ee
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.wso2.ballerinalang.compiler.semantics.analyzer.Types;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BTypeSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.Symbols;
import org.wso2.ballerinalang.compiler.semantics.model.types.BArrayType;
import org.wso2.ballerinalang.compiler.semantics.model.types.BField;
Expand Down Expand Up @@ -182,9 +183,10 @@ private JsonObject generateRecordType(BRecordType effectiveType, BIntersectionTy
if (!requiredFields.isEmpty()) {
typeNode.add("required", requiredFields);
}
// The tsymbol name is empty for anon intersection type created due to inferred readonly
if (intersectionType.tsymbol.name != Names.EMPTY) {
typeNode.addProperty("name", intersectionType.tsymbol.toString().trim());
BTypeSymbol intersectionSymbol = intersectionType.tsymbol;
// The tsymbol name is implicitly empty
if (intersectionSymbol.name != Names.EMPTY) {
typeNode.addProperty("name", intersectionSymbol.toString().trim());
} else {
// Get record type and set the type name as a property
for (BType bType : intersectionType.getConstituentTypes()) {
Expand Down

0 comments on commit 75df9ee

Please sign in to comment.