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

Assigning this into arrays broken #110

Closed
TobiasWrigstad opened this issue Mar 10, 2015 · 1 comment
Closed

Assigning this into arrays broken #110

TobiasWrigstad opened this issue Mar 10, 2015 · 1 comment

Comments

@TobiasWrigstad
Copy link
Contributor

class Foo 
  def bar() : void
    let 
      a = new [Foo](1)
    in 
      a[0] = this

compiles fine in Encore, but spits out this C code:

void* Foo_bar(_enc__active_Foo_t* this)
{
  /* a = [Foo](1) */;
  int64_t _literal_2 = 1;
  array_t* _array_0 = array_mk(_literal_2, ENCORE_PRIMITIVE);
  array_t* _a_3 = _array_0;
  int64_t _literal_4 = 0;
  array_set(_a_3, _literal_4, ((encore_arg_t) {.p = (*this).aref})); // <============== Problem! 
  return UNIT;
}

which uses the old aref.

@TobiasWrigstad
Copy link
Contributor Author

I just double-checked — this is fixed.

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