Support for Annotated in Links for Cleaner Type Checking #1083
edersilva78
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I wanted to bring up a type-checking issue and propose an enhancement.
When defining a Link in a Document model like this:
The type checker (and IDE) identifies another_doc as being of type Link rather than AnotherDoc. This creates friction when working with tools that rely on type annotations for static analysis and code suggestions.
To address this, would it be possible (or feasible) to define links using Annotated? For example:
This approach could preserve type information for tools while still conveying the Link semantics to the runtime or ORM.
I’d love to hear your thoughts on whether this could be implemented or if there’s a better way to address this issue.
Thank you for your work on this project!
Best regards,
Eder
Beta Was this translation helpful? Give feedback.
All reactions