-
Notifications
You must be signed in to change notification settings - Fork 306
[WIP] compiler: extern fn
#8119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
commit: |
❌ There is undocummented changes. Run The following packages have changes but are not documented.
Show changes |
You can try these changes here
|
You can see that the two properties where the type is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will review in detail in bit. Thinking about rolling this out:
- We should validate that there are no compile breaks in typespec-azure or typespec-azure-pr
- We should talk to TCGC folks about whether they want to support this for some scenarios
- We should think about preventing usage in Azure specs until TCGC is ready to support (linting rules)
- We should think about some http-specs scenarios for this
- We should add some website conceptual documentation
This is a proof-of-concept for
extern
functions, (related: #7296)fn
declarations, with a requiredextern
keyword, which bind a typeFunctionType
withkind: "Function"
.FunctionType
to theType
union.fn
declarations must have an associated JS implementation (for now -- we may eventually allow implementations to be defined in TypeSpec itself).fn
declarations to allow mixed constraints in return type position.tspd
extern signature generation for functions alongside decorators.target: FunctionType
This strategy replaces the
extern alias
proof of concept, allowing aliases to simply invoke functions: