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

Type inference is not working correctly #152

Open
PtrMan opened this issue Nov 14, 2020 · 0 comments
Open

Type inference is not working correctly #152

PtrMan opened this issue Nov 14, 2020 · 0 comments

Comments

@PtrMan
Copy link

PtrMan commented Nov 14, 2020

The compiler should infer types correctly and not push type-inference to the backend (C).

If this is a code issue, provide a minimal code example:

include "math.h";
function exp(v:(Float64,Float64)):(Float64,Float64) {
    var r = expf(v[0]);
    var d = 0.0;
    return (r,d);
}

gives a compile error from the gcc:

Error: build/lib/kit_test0.c: In Funktion »test0__exp«:
build/lib/kit_test0.c:19:12: Fehler: unverträgliche Typen bei Rückgabe von Typ »struct tuple2bf0b99cc56f6aa69d896315«, aber »struct tuplee7731a893109b41a186a62ef« wurde erwartet
   19 |     return (struct tuple2bf0b99cc56f6aa69d896315) {.__slot0 = r, .__slot1 = d};
      |            ^
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