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

[Bug]: Record constructor is not supported within a record-destructure or tuple-destructure #42352

Closed
dulajdilshan opened this issue Mar 20, 2024 · 2 comments
Labels
Area/Compiler Reason/Invalid Issue is invalid. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug userCategory/Compilation

Comments

@dulajdilshan
Copy link
Contributor

Description

It is not supported to have record-constructor in record binding pattern.

With #40283 fix, we have aligned the same behaviour in record-constructor for tuple-destructure.

Steps to Reproduce

Sample scenario in record destructure.

int a;
int b;
{a, b} = {a: 1, b: 2};    // error: record literal is not supported for record binding pattern

Sample scenario in tuple destructure.

int a;
int b;
[{a, b}] = [{a: 1, b: 2}];    // error: record literal is not supported for record binding pattern

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

Related issues:

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Mar 20, 2024
@dulajdilshan dulajdilshan added Area/Compiler Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. and removed needTriage The issue has to be inspected and labeled manually labels Mar 20, 2024
@dulajdilshan
Copy link
Contributor Author

Same as a combination of #19804 and #39324, hence closing this

Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@dulajdilshan dulajdilshan added the Reason/Invalid Issue is invalid. label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Compiler Reason/Invalid Issue is invalid. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug userCategory/Compilation
Projects
None yet
Development

No branches or pull requests

2 participants