-
Notifications
You must be signed in to change notification settings - Fork 10
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
Tink is not working? #19
Comments
I'm not convinced it should actually make an implicit return here. How would one otherwise write a function that returns nothing? If you want all functions to return implicitly, you should simply always generate a return statement, e.g.: class Main {
static dynamic public function main() return {
trace(test());
var args = Sys.args();
Sys.setCwd(args.pop());
new Dispatch(args).dispatch(new Cli());
};
static dynamic public function test() return {
"Hello";
};
} |
And how then implicit returns in Tink work? |
Tomas, just a wild idea, couldn't implicit returns be supported by adding a On Fri, Oct 2, 2015 at 2:20 AM, Tomas Slusny notifications@github.com
|
@fullofcaffeine This is not the right place to talk about Raxe. And yes, sometimes it is possible, but sometimes it isn't, and I am afraid that there are a lot places where it isn't possible. I can close this issue here then, because as it seems, implicit returns do not works everywhere where it works in languages what have implicit returns, what is a pity :( Okay, closing. |
@deathbeam Yes, I can see how the documentation might be misleading. I will reopen this issue and close when I've had time to improve it. The short version: tink uses implicit returns in the places where it is absolutely clear that the function must return something, and currently that's only accessors. I should probably extend that to functions that define a return type. |
Hey everyone. I am building my own programming language on top of Haxe, and I want to use Tink to ease some parts of it. For example implicit returns. This is code generated by my language compiler. As you can see, it is inserting @:tink before class name. But it is not working and Haxe compiler is throwing error where Tink should recognize the implicit return.
My hxml looks like this:
So, am I doing something wrong?
The text was updated successfully, but these errors were encountered: