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]: Invalid syntax tree around qualified name ref followed by a map variable declaration #39016

Closed
IMS94 opened this issue Dec 12, 2022 · 1 comment · Fixed by #41131
Closed
Assignees
Labels
Area/Parser Everything related to the ballerina lexer and the parser #Compiler Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug

Comments

@IMS94
Copy link
Contributor

IMS94 commented Dec 12, 2022

Description

Consider this code:

import ballerina/module1;

public function main() {
    module1:<cursor>

    map<int> m = {};
}

Cursor is at <cursor>. When we visualize the syntax tree, node at cursor is simple name reference of the following form:

 MISSING[     INVALID[module1] INVALID[:]

     INVALID[map] INVALID[<] INVALID[int] INVALID[>]  INVALID[m] ]

Ideally it should have been a qualified name reference. This doesn't happen for cases like below:

import ballerina/http;

public function main() {
    http:

    string m = "";
}

and

import ballerina/http;

type Data record {|

|};

public function main() {
    http:

    table<Data> tbl = table [];
}

Steps to Reproduce

No response

Affected Version(s)

No response

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

@IMS94 IMS94 added Type/Bug Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Area/Parser Everything related to the ballerina lexer and the parser #Compiler labels Dec 12, 2022
@rdulmina rdulmina self-assigned this Jul 31, 2023
@github-actions
Copy link

github-actions bot commented Aug 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Parser Everything related to the ballerina lexer and the parser #Compiler Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants