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

Invalid Java generation for function eval with unused result #622

Open
kevin-m-knight-gs opened this issue Oct 21, 2022 · 0 comments
Open

Comments

@kevin-m-knight-gs
Copy link
Contributor

Bug Report

Steps to Reproduce:

The following code compiles in Pure, but yields a Java compilation error in compiled mode.

import test::*;

function test::inspect<T|m>(values:T[m], fn:Function<{T[m]->Any[*]}>[1]):T[m]
{
    $fn->eval($values);
    $values;
}

function test::test():Any[*]
{
    inspect([1, 2, 3, 4], v | $v->map(i | $i->toString())->joinStrings('[', ', ', ']\\n'))
}

An ignored failing test was added for this in this commit.

Expected Result:

The Java code that is generated for the Pure code should compile (and behave correctly).

Actual Result:

What actually happens is a Java compilation error which complains that the generated Java code is not a statement.

Environment:

This was reproduced with legend-pure 3.7.0 and JDK 11.0.16.

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

No branches or pull requests

1 participant