-
Notifications
You must be signed in to change notification settings - Fork 311
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
Make Fable AST independent of FCS #2138
Conversation
@alfonsogarciacaro Looks good, it will eliminate a lot of impedance and unnecessary pasta code that was previously needed because Fable AST was missing some elements of FSharp AST, hence the need to keep and inspect both at later stages. Since this is an internal change, in theory we should be able to resolve all errors and restore full functionality before other big changes are introduced. |
@alfonsogarciacaro module Library
let res = 0 open Library
let test = fun () -> res
[<EntryPoint>]
let main argv =
test () compiles to: import { res } from "./Library.js";
export const test = res;
(function (argv) {
return test(); // <-- Error: test is not a function
})(process.argv.slice(2)); Could be some sort of optimization issue, not sure. |
Oh, my, had I seen your comment before I could have saved a lot of time trying to pinpoint the issue. Yes, it was this: ea45ca1#diff-642c2bef493bb0bb4c567fd3b854b15dL956 That's the code handling "import expressions" as in: Anyways, this is finally green! It's not perfect yet, but let's merge it so we can move forward with Nagareyama 👍 |
This was supposed to fix #2087 but then I started another AST cleanup, tried to make Fable.AST independent of FCS and then everything become red 😮 Finally the project builds again but I need to fix the tests. It's gonna be difficult to make a proper review because the PR is too big and the reasons behind many of the changes are only in my head atm, but if you have a moment @ncave please do have a look to see if this makes sense to you.
Next steps I think this could unblock: