@Override public BType getCollectionType(char typeChar, List<BType> memberTypes) { switch (typeChar) { case 'O': return new BUnionType(memberTypes); case 'P': return new BTupleType(memberTypes); default: throw new IllegalArgumentException("unsupported collection type char: " + typeChar); } }
private BValueArray createEmptyRefValueArray(BType type, int length) { List<BType> memberTypes = new ArrayList<>(2); memberTypes.add(type); memberTypes.add(BTypes.typeNull); BUnionType unionType = new BUnionType(memberTypes); return new BValueArray(new BRefType[length], new BArrayType(unionType)); }
targetType = new BUnionType(memberTypes);