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

Passive classes: order matters #23

Closed
kaeluka opened this issue Aug 4, 2014 · 1 comment
Closed

Passive classes: order matters #23

kaeluka opened this issue Aug 4, 2014 · 1 comment
Labels

Comments

@kaeluka
Copy link
Contributor

kaeluka commented Aug 4, 2014

The following program works:

#! /usr/bin/env encorec -run

passive class X
  x:int

class Main
  def main() : void {
    let x = new X in {
        print x.x
    }
  }

But this one doesn't:

#! /usr/bin/env encorec -run

class Main
  def main() : void {
    let x = new X in {
        print x.x
    }
  }

passive class X
   x:int

The only difference is the order of declaration. This is due to the fact that sizeof(X) doesn't work in C, if X is only forward declared. Tobias already suggested compiling each file to its own C-file. This would fix this issue, so I recommend we do not address this other than refactoring the backend (which was the plan anyway)

@kaeluka kaeluka added the bug label Aug 4, 2014
@EliasC
Copy link
Contributor

EliasC commented Aug 13, 2014

Fixed as of e338e1e (refactoring of code generation)

@EliasC EliasC closed this as completed Aug 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants