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

Early return from @async function() : Void ends with compile time error at tink_syntaxhub/0,5,0/src/tink/SyntaxHub.hx:35 #45

Open
Jens-G opened this issue Nov 28, 2021 · 0 comments

Comments

@Jens-G
Copy link

Jens-G commented Nov 28, 2021

This is not possible:

 @async static function Foo(tell_us:Bool) : Void {
	if (!tell_us)
		return;  // exit right away
		
	trace("This is Foo");
}

Since this is a Void function returning null instead (as advised elsewhere) only gives another error.

Library used is the haxelib version.

Full error:

C:\HaxeToolkit\haxe\lib\tink_syntaxhub/0,5,0/src/tink/SyntaxHub.hx:35: characters 5-89 : Expected Array<Field> but got [{name: main, doc: null, pos: #pos(src/Main.hx:14: lines 14-39), access: [AStatic], kind: FFun({ret: null, params: [], expr: {pos: #pos(C:\HaxeToolkit\haxe\lib\tink_syntaxhub/0,5,0/src/tink/SyntaxHub.hx:35: characters 5-89), expr: EBlock(<...>)}, args: []}), meta: [{name: await, params: [], pos: #pos(src/Main.hx:14: characters 2-8)}], name_pos: #pos(src/Main.hx:14: characters 25-29)},{name: Log, doc: null, pos: #pos(src/Main.hx:41: lines 41-45), access: [AStatic], kind: FFun({ret: TPath({name: <...>, params: <...>, pack: <...>}), params: [], expr: {pos: #pos(src/Main.hx:41: lines 41-45), expr: EReturn(<...>)}, args: [{name: <...>, opt: <...>, meta: <...>, type: <...>, name_pos: <...>, value: <...>}]}), meta: [{name: async, params: [], pos: #pos(src/Main.hx:41: characters 2-8)}], name_pos: #pos(src/Main.hx:41: characters 25-28)},{name: Foo, doc: null, pos: #pos(src/Main.hx:47: lines 47-52), access: [AStatic], kind: FFun({ret: TPath({name: <...>, params: <...>, pack: <...>}), params: [], expr: {pos: #pos(src/Main.hx:47: lines 47-52), expr: EReturn(<...>)}, args: [{name: <...>, opt: <...>, meta: <...>, type: <...>, name_pos: <...>, value: <...>}]}), meta: [{name: async, params: [], pos: #pos(src/Main.hx:47: characters 3-9)}], name_pos: #pos(src/Main.hx:47: characters 26-29)}] (see dump/decoding_error.txt for details)
Build halted with errors.
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