Skip to content
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

Add const template parameter to get the precise lib type #3933

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin commented Jul 22, 2024

Found those issue when working on uri template, splitting it from the uri template PR as its not really related.

Basically when using createTypeSpecLibrary({...} as const its not the same as doing

const libDef = {...} as const;
const $lib = createTypeSpecLibrary(libDef);

In the first case the paramMessage format param are not typed so we are missing errors which are fixed in this PR.

@timotheeguerin timotheeguerin marked this pull request as ready for review July 22, 2024 22:00
@azure-sdk
Copy link
Collaborator

azure-sdk commented Jul 22, 2024

All changed packages have been documented.

  • @typespec/compiler
  • @typespec/http-server-javascript
  • @typespec/http
  • @typespec/protobuf
Show changes

@typespec/compiler - fix ✏️

Add const template parameter to get the precise lib type

@typespec/http-server-javascript - fix ✏️

Fix some diagnostic not showing the right message

@typespec/http - fix ✏️

Fix some diagnostic not showing the right message

@typespec/protobuf - fix ✏️

Fix some diagnostic not showing the right message

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@timotheeguerin timotheeguerin added this pull request to the merge queue Jul 22, 2024
Merged via the queue into microsoft:main with commit 6aad4a7 Jul 22, 2024
22 checks passed
@timotheeguerin timotheeguerin deleted the lib-const branch July 22, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants