ballerina-spec
ballerina-spec copied to clipboard
Intersection types in included record parameters and record type inclusion
Description:
The spec says
for included record parameters
The type-reference in an included-record-param must refer to a type defined by a record-type-descriptor.
The type-reference must reference a type described by a record-type-descriptor.
Therefore, the following are not allowed (in jBallerina) at the moment, but can't we allow these?
type Record readonly & record {|
int i;
string j;
|};
function fn(*Record t) { // compilation error at the moment
}
type Record2 record {|
*Record; // compilation error at the moment
byte i;
|};
We should allow this.