Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Using super in an async method breaks #499

Closed
vsmenon opened this issue Apr 15, 2016 · 3 comments
Closed

Using super in an async method breaks #499

vsmenon opened this issue Apr 15, 2016 · 3 comments

Comments

@vsmenon
Copy link
Contributor

vsmenon commented Apr 15, 2016

This results in code that does not parse in V8. V8 complains about an illegal super.

Future foo() async {
  var result = await super.foo();
  return result;
}

I can work around by creating a non-async helper method that forwards to the super class.

@vsmenon
Copy link
Contributor Author

vsmenon commented Apr 15, 2016

DDC. I assume it works in dart2js (or at least compiles the code to
something that parses - no idea if it is actually used at runtime in the
app I'm looking at :-).

On Fri, Apr 15, 2016 at 10:12 AM, Lasse R.H. Nielsen <
notifications@github.com> wrote:

Is this dart2js or DDC?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#499 (comment)

@jmesserly
Copy link
Contributor

ah, yeah, that's not too surprising. It desugars to function* and unlike => it probably doesn't support super.

I think we might've had similar issues with anything that uses .bind(this) ... from a quick search, visitFunctionDeclarationStatement has a similar problem (it is completely unnecessary there, we could've used =>).

@jmesserly
Copy link
Contributor

I can work around by creating a non-async helper method that forwards to the super class.

yeah, something like that is probably the solution for us too in code_generator :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants