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]: Shift operations give compile time error for valid case #42875

Open
chiranSachintha opened this issue Jun 7, 2024 · 0 comments
Open
Labels
needTriage The issue has to be inspected and labeled manually Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug userCategory/Compilation

Comments

@chiranSachintha
Copy link
Member

Description

$title.

public function main() {
    [int, int|int, int...] tupleWithVariableInherentTypes1 = [1, 1, 1];
    var x = tupleWithVariableInherentTypes1.shift();
}

For this, we are currently getting the error:

cannot call 'shift' on tuple(s) of type '[int,int,int...]': cannot violate inherent type

Steps to Reproduce

No response

Affected Version(s)

2201.9.0

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@chiranSachintha chiranSachintha added Type/Bug Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. labels Jun 7, 2024
@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needTriage The issue has to be inspected and labeled manually 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