ballerina-platform / ballerina-lang

The Ballerina Programming Language
https://ballerina.io/
Apache License 2.0
3.54k stars 733 forks source link

[Bug]: Invalid subtyping between `int[2][][5]` and `int[][]` #42648

Closed lochana-chathura closed 2 weeks ago

lochana-chathura commented 2 weeks ago

Description

Getting this invalid subtyping relationship in the current nutcracker branch.

type A int[2][][5];

// A<:B
type B int[][];

Tested the relationship between the above two types in nBallerina repo with --showTypes. It gives no relationships as expected. So this has to be a porting issue.

Steps to Reproduce

  1. Copy the above sample to a bal file and save it under the data directory.

  2. Then run the below verifyAllSubtypeRelationships() test. https://github.com/ballerina-platform/ballerina-lang/blob/468f4d50505380d997bc7e0fbb10ab247bf38895/tests/jballerina-semtype-port-test/src/test/java/io/ballerina/semtype/port/test/SemTypeTest.java#L203

Affected Version(s)

nutcracker branch

lochana-chathura commented 2 weeks ago

Fixed in #42650