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

Closures can't handle polymorphic parameters #377

Closed
Bearmarshal opened this issue Apr 13, 2016 · 3 comments
Closed

Closures can't handle polymorphic parameters #377

Bearmarshal opened this issue Apr 13, 2016 · 3 comments
Assignees

Comments

@Bearmarshal
Copy link

class Main {
  def main() : void {
    let foo = new Foo<int>(413);
  }
}

passive class Foo<t> {
  fun : () -> Bar<t>

  def init(item : t) : void {
    this.fun = \ () -> new Bar<t>(item);
  }
}

passive class Bar<t> {
  item : t

  def init(item : t) : void {
    this.item = item;
  }
}

When compiling the above code, Clang gives the following error:

Main_src/Foo.encore.c:59:31: error: use of undeclared identifier '_this'
  _enc__type_init_Bar(_new_0, _this->_enc__type_t);
@albertnetymk
Copy link
Contributor

Confirmed. Fix on the way.

@albertnetymk albertnetymk self-assigned this Apr 13, 2016
@TobiasWrigstad TobiasWrigstad added this to the April'16 Sprint milestone Apr 14, 2016
@kikofernandez
Copy link
Contributor

@albertnetymk how is this one going? Did you fix it?

@kikofernandez
Copy link
Contributor

I see that it was fixed! (@albertnetymk next time, write Fix #377 with the hash in front of the number)

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

4 participants