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

undeclared identifier in c code #55

Closed
jupvfranco opened this issue Jan 28, 2015 · 1 comment
Closed

undeclared identifier in c code #55

jupvfranco opened this issue Jan 28, 2015 · 1 comment

Comments

@jupvfranco
Copy link

I'm getting an error when I compile this small program.
Use of undeclared identifier 'res' and I don't undertand why.

class Main 

class Foo
    def getBar(): Bar {
        new Bar
    }
    def foo(): Bar { 
        let res = new Bar
        in {
            let foo = new Foo 
                v = get foo.getBar()
            in () ;
            res         
        }
    }
passive class Bar 
    x: real
    y: real 

I checked the generated C code and the variable res is declared as '_res_1' and used in the return expression as 'res'
Bar_data* _res_1 = _new_0;
... some code here ...
return res;

bug_let

Thanks

@EliasC
Copy link
Contributor

EliasC commented Jan 29, 2015

Fixed as of 2b8edce. The culprit was the backend unsubscribing more variables than it was supposed to.

@EliasC EliasC closed this as completed Jan 29, 2015
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

2 participants