haxetink / tink_await

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

Compile error #35

Closed darmie closed 4 years ago

darmie commented 4 years ago

I am using Haxe version 4.0 rc.5

I can't compile this code.

Code:

function writeFuncType(t:FunctionSig) {
    try {
        if (t.paramTypes.length != 0)
            writeString(" (param");
        for (p in t.paramTypes) {
            writeString(" ");
            writeString(p);
        }
        writeString(")");

        if (t.returnTypes.length != 0)
            writeString(" (return");
        for (r in t.returnTypes) {
            writeString(" ");
            writeString(r);
        }
        writeString(")");
        return Future.sync(true);
    } catch (e:Dynamic) {
        throw e;
    }
}

@async function writeFuncSignature(t:FunctionSig) {
    this.writeString("(func");
    @await writeFuncType(t);
        this.writeString(")");
}

Error: ../tink/await/AsyncField.hx:470: characters 27-39 : String should be Null<haxe.macro.FunctionKind>

kevinresol commented 4 years ago

Please post a complete and self-contained snippet

benmerckx commented 4 years ago

This seems like a user code error without a proper position. Are you using tink_await from git?

darmie commented 4 years ago

@kevinresol self-contained how?

@benmerckx I am using the haxelib version.

darmie commented 4 years ago

@kevinresol the recent git update fixed it. Thanks

francescoagati commented 4 years ago

i have this problem with haxe 4.0 (last release) and tink_await (git version) maybe i must update some other tink dependency?

CrazyFlasher commented 3 years ago

Have the same error, if I includelibrary -lib hexinject (just add it in build command together with -lib tink_await)

"hexinject": "git:https://github.com/CrazyFlasher/hexInject.git#73b59e0dccc6f181f3858ff7ee441283345abb1c"

https://github.com/CrazyFlasher/domwires-haxe

CrazyFlasher commented 3 years ago

funny, but it works if I put tink_await befor hexinject

//compiles
-lib tink_await
-lib hexinject

//doesn't compile
-lib hexinject
-lib tink_await