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

Promise<Dynamic> and .next - runtime exceptions #173

Open
gene-pavlovsky opened this issue Jun 26, 2023 · 0 comments
Open

Promise<Dynamic> and .next - runtime exceptions #173

gene-pavlovsky opened this issue Jun 26, 2023 · 0 comments

Comments

@gene-pavlovsky
Copy link
Member

The usage of Dynamic in the example code below doesn't make much sense, but is just a minimal reproducible sample of the issue. The issue occurs in a real project where Dynamic in the actual code makes (a bit) more sense.

Notes:

  • Use Haxe 4.2.5 in try-haxe settings, otherwise the examples don't compile (some errors related to tink_core)
  • Remove :Dynamic in either example to see the expected result

Issue 1

https://try.haxe.org/#cAe829Cb

final value:Dynamic = { success: true };
Promise.lift(value).next(v -> v.success).handle(o -> trace(o));

Uncaught TypeError: this1.getStatus is not a function,https://try.haxe.org/program/cAe829Cb/run?r=0.13856380911375776,line:489

Issue 2

https://try.haxe.org/#58722815

final service:Dynamic = js.lib.Promise.resolve({ success: true });
Promise.ofJsPromise(service).next(v -> v.success).handle(o -> trace(o));

Uncaught TypeError: next(...).handle is not a function,https://try.haxe.org/program/58722815/run?r=0.009096519480646048,line:530

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