haxetink / tink_await

Haxe async/await
MIT License
58 stars 15 forks source link

Issues with flow control. #6

Open back2dos opened 8 years ago

back2dos commented 8 years ago

Currently, there is nothing in place to ensure an async function ever completes. Simplest example:

@async function foo() {
}

This will generate something along the lines of:

function foo() return Future.async(function (__return) {})

There should be something to prevent that from happening.

back2dos commented 8 years ago

Just to be clear: the above example is trivial of course. But in a complex method, if you forget to return in some branch, it goes unnoticed. That's the real problem.

benmerckx commented 8 years ago

You're right. There's also other areas (where a value is expected) where we can't trust the compiler to throw an understandable warning after all is transformed. This will take some time, but isn't impossible I think.