Skip to content

Commit

Permalink
fix: Fix declaration order bug once again
Browse files Browse the repository at this point in the history
Consider:

```fsharp
type A = | A of (int * A) list
```

When the type `int * A` is required, the previous algorithm does:

- try `int * A`
- try `A`
- emit `A`
- try `(int * A) list`
- try `int * A` (known)
- emit `(int * A) list`
- emit `int * A`

and then error because the type of the `head` is incomplete.

The new algorithm defers to generate type definitions as possible.
One of flaws is the generator must be carefully where C compilers
require types to be complete.
  • Loading branch information
vain0x committed Sep 25, 2019
1 parent ff437e2 commit fa9a1d9
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 203 deletions.

0 comments on commit fa9a1d9

Please sign in to comment.