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

[Master] Generate new typedesc instruction for record and tuple when type descriptor resolving #43596

Open
wants to merge 105 commits into
base: master
Choose a base branch
from

Conversation

rdulmina
Copy link
Contributor

@rdulmina rdulmina commented Nov 18, 2024

Purpose

In this PR, I have generated a new 'typedesc' (type descriptor) only once for the tuple and record.
For example:

type Foo record {||};
public function main() {
    Foo f = {};
    record {|int a;|} r = {a: 1};
}

We have desugared the above program as follows:

type Foo record {||};
typedesc<Foo> $typedesc$Foo = Foo;
public function main() {
    Foo f = {};
    typedesc<record {| int a; |}> $typedesc$$anonType$_0 = record {| int a; |}
    record {|int a;|} r = {a: 1};
}

We then use the generated 'typedesc' when creating a map value using that type.

Fixes #38844, #41946, #43311, #43715

chiranSachintha and others added 30 commits August 16, 2024 17:05
Add closures before the dependent node in the top-level node list in `ClosureGenerator.java`
Exclude field generation for typedesc when generating fields for user defined types since those fields will be generated when visiting global variables
Add typedesc statement before the var declaration in the init function body
Previously we set the annotation for record type only. Now we set for both the type reference type and record type
@rdulmina rdulmina requested a review from HindujaB November 20, 2024 04:40
@rdulmina rdulmina requested a review from MaryamZi November 26, 2024 10:47
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Generate new typedesc instruction for record and tuple when type descriptor resolving
3 participants