Keep doc comments, @deprecated, @throws and @genType on let values in created interfaces
Why
Create interface printed a let value from its type alone, so its doc comment and its @deprecated were lost and callers got no warning 3 once the .resi existed. The attributes are now read from the binding in the source and printed in front of each value it binds.
modifiedFormat create interface
/** Doc of f. */@deprecated("use g")let f = x => x + 1@deprecated("use y") @inlinelet inlined = 4
rescript
Before
After
/** Doc of f. */@deprecated("use g")let f: int => intlet f: int => int@deprecated("use @inlinelet inlined: int@deprecated("use y")@inline let inlined: int
Review
- Which attributes are kept? Doc comments, @deprecated, the genType family and reanalyze's @throws, @live and @dead, which are read from an interface; @warning, @inline and the like describe the implementation.