Closed ceedubs closed 2 months ago
Oh this goes beyond Doc
. I see the same thing for literals of Nat
, Bytes
, Text
, and presumably any other builtin.
Aside: Doc literals aren't AST elements like Nat
is, they are just syntax sugar for regular function calls. The treatment of Nat
literals and whether they count as a dependency on Nat
is separate.
dependencies
/ dependents
will only show types that are specifically mentioned in a type signature of the function, or types with constructors that you explicitly call or pattern match in the function. It does not like look up the type signature of every function you call internally and record that as a type dependency. Should it?Transitive dependents / dependencies would reveal this.
dependents docParagraph
or dependents docWord
should do it since doc literals desugar into calls to those functions (among others).
Based on Paul's comment I'm going to close this out. It's not clear that the current behavior is wrong. If we determine it to be an issue we can always reopen.
Describe and demonstrate the bug
If a term has
Doc
in the type signature (such as its return type beingDoc
) then it is recognized as a dependent ofDoc
. But if the term has an internalDoc
literal, then it doesn't get flagged as being dependent onDoc
.Edit: This seems to be true for literals of any builtin type (
Nat
,Bytes
,Text
, etc); not justDoc
.Additional context
This came up when I was trying to identify anywhere that doc literals were being used for inline comments that might cause unnecessary runtime overhead when the doc was really just meant for the reader of the code and not something that we care about evaluating at runtime.