fponticelli / thx.core

Super-charged standard library for Haxe.
http://thx-lib.org
MIT License
124 stars 43 forks source link

added type hints to returns from a few anonymous functions #249

Closed ghost closed 7 years ago

ghost commented 7 years ago

In order to get thx.core to compile on the linux (cpp) and android targets I had to alter the way types were indicated in the returns from a few functions. I opted for the (thing : Type) syntax in the return statement.

I see that a change was made about 9 days ago to Iterables.unionBy and Iterables.differenceBy to add explicit return types to the anonymous functions. It seems, however, that the generated cpp was inserting an incorrect cast after the return statement but before the return value, which caused a unification error. E.g. return (WrongType) value; in the cpp.

See issue #248 for the types of errors that were appearing.

I have tested these changes on linux, android, neko, and html5 targets with no compile or runtime errors.

Let me know if this works for you :)

fponticelli commented 7 years ago

Thank you!