Open DanTup opened 1 year ago
... I'm not sure what dartdoc would do here ...
I'm not either, but we should be consistent. I don't think it would be terrible for DartDoc to substitute the real type for a private typedef, but it might make the output harder to read.
@srawlins
I'm also not sure, but I can add a test to dartdoc to see what it would do. Stay tuned.
Sometimes I want to use a
typedef
as an alias within a file, because a type is large and unwieldy. I don't want to expose the typedef because it's really just there to make this file more readable. Externally I want the type to look like the aliased type.This reports an error that I'm using a private type in a public API, but really I want the type alias to be invisible outside of this file - I want it to act like:
I just don't want to have to write that whole type in the API.
This might be at odds with dart-lang/sdk#58350 though. That describes exactly this situation, but I don't know if the typedef was used because it was an easy way to illustrate the problem, or if there's a reason why using the private typedef causes other issues (for example I'm not sure what dartdoc would do here.. you probably wouldn't want the private typedef showing up in places like documentation?).