Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type loosing type name when there is annonymous type of same shape #37038

Open
ushirask opened this issue Jul 18, 2022 · 0 comments
Open

Type loosing type name when there is annonymous type of same shape #37038

ushirask opened this issue Jul 18, 2022 · 0 comments
Assignees
Labels
Points/1 Equivalent to one day effort Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug

Comments

@ushirask
Copy link
Contributor

Description:
The type name of a tuple typedesc is removed at runtime if there is an anonymous type of the same shape

Steps to reproduce:

import ballerina/io;

function foo() {
    var [a, ...b] = getData();
    io:println(a, b);
}

function getData() returns [int, int, string...] {
    return [1, 2, "hello", "world"];
}

type T [int, string...];

public function main() {
    T x = [1, "a", "b"];
    io:println(x);
}

Here type name of x is "" and not "T" as expected.

Affected Versions:

OS, DB, other environment details and versions:

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

@KRVPerera KRVPerera added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label Aug 10, 2022
@MaryamZi MaryamZi added this to Planned for the Sprint in Sprint 62 - Compiler Frontend, Integration and Parser via automation Aug 10, 2022
@MaryamZi MaryamZi added the Points/1 Equivalent to one day effort label Aug 10, 2022
@MaryamZi MaryamZi moved this from Planned for the Sprint to In Progress in Sprint 62 - Compiler Frontend, Integration and Parser Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Points/1 Equivalent to one day effort Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants