haxetink / tink_core

Core utilities
https://haxetink.github.io/tink_core
MIT License
116 stars 33 forks source link

Native compilation error when building against CS target #169

Closed alexeychikk closed 1 year ago

alexeychikk commented 1 year ago

I've just installed your tink_core and tink_await libraries and trying to build against cs target. Seems like build fails because the native compilation of C# code itself fails. Am I missing some setup?

# build.hxml
--class-path src
--library hxcs
--library tink_await
--library tink_core
--main Main
--cs dist
// Main.hx
using tink.CoreApi;

@await class Main {
  @await static public function main() {
    trace("Hello async");
  }
}
$ haxe build.hxml
haxelib run hxcs hxcs_build.txt --haxe-version 4205 --feature-level 1 --out dist/bin/Main
src\tink\core\Error.cs(149,250): error CS0030: Cannot convert type 'tink.core.TypedError<T>' to 'tink.core.TypedError<object>'
src\tink\core\Progress.cs(1004,32): error CS0100: The parameter name '_' is a duplicate
Compilation error
Native compilation failed
back2dos commented 1 year ago

Would be worth checking with Haxe 4.3. Other than that -D erase-generics should work too, as used in the CI.

alexeychikk commented 1 year ago

Haxe 4.3 doesn't make a difference, while -D erase-generics helps.