Carp icon indicating copy to clipboard operation
Carp copied to clipboard

Scoring is sometimes wrong for nested types

Open scolsen opened this issue 4 years ago • 1 comments

I'm still trying to find a simple example that triggers the issue, but when one have a complex enough usage of types nested inside a module (defmodule Foo (deftype Bar)) the scoring for functions that depend on the nested type is sometimes incorrect (functions are emitted before the type definition).

scolsen avatar Oct 23 '21 17:10 scolsen

One thing I was considering lately because it would greatly simplify emissions for recursive types is forward declaring all types in the type env prior to their actual struct definitions, e.g. typedef struct Foo Foo; at the very beginning of the file. It'd require us to change how members are emitted but would presumably fix this problem too.

scolsen avatar Oct 23 '21 17:10 scolsen