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

TC gives incorrect type for tuple concat with multiple labels #746

Closed
PaulKlint opened this issue Dec 19, 2014 · 1 comment
Closed

TC gives incorrect type for tuple concat with multiple labels #746

PaulKlint opened this issue Dec 19, 2014 · 1 comment

Comments

@PaulKlint
Copy link
Member

In commit dd9a74d it was demonstrated that the interpreter did not drop all labels when there are duplicate labels in a tuple concatenation while this is the desired behavior.
The type checker also computes duplicate fields names instead of dropping all field names.

In this example

module experiments::Compiler::Examples::Tst2
import Type;
tuple[int x, str s] a = <10, "abc">;
tuple[real x] b = <3.14>;
value main(list[value] args) = (a + b) has x; // !((a + b) has x);

the type of (a + b) is computed as

tuple([label("x",int()),label("s",str()),label("x",real())])

while it should be

tuple([int(),str(),real()])
@PaulKlint
Copy link
Member Author

Great, this works fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants