Skip to content

[compiler] Fix some issues with functions#10880

Merged
witemple-msft merged 2 commits into
microsoft:mainfrom
witemple-msft:witemple-msft/fn-fixes
Jun 5, 2026
Merged

[compiler] Fix some issues with functions#10880
witemple-msft merged 2 commits into
microsoft:mainfrom
witemple-msft:witemple-msft/fn-fixes

Conversation

@witemple-msft
Copy link
Copy Markdown
Member

  • Functions were previously not correctly validating that arguments assigned to the rest parameter constraint were compatible with the constraint. This fixes that issue and adds a regression test.
  • Function diagnostics were incorrectly targeted in some cases that this change addresses.
  • Function type signatures in tspd were rendered a little bit incorrectly and this PR addresses that.
  • Function documentation had a few typos that this PR fixes (TypeScript -> TypeSpec, one invalid identifier in an example)

@microsoft-github-policy-service microsoft-github-policy-service Bot added compiler:core Issues for @typespec/compiler meta:website TypeSpec.io updates tspd Issues for the tspd tool labels Jun 3, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 3, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/compiler@10880
npm i https://pkg.pr.new/@typespec/tspd@10880

commit: ca19506

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

All changed packages have been documented.

  • @typespec/compiler
  • @typespec/tspd
Show changes

@typespec/compiler - fix ✏️

Validate function rest arguments and report function call argument count diagnostics at call sites.

@typespec/tspd - fix ✏️

Render function type signatures with arrow syntax and avoid internal compiler imports.

@azure-sdk-automation
Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@witemple-msft witemple-msft added this pull request to the merge queue Jun 5, 2026
Merged via the queue into microsoft:main with commit 8351992 Jun 5, 2026
33 checks passed
@witemple-msft witemple-msft deleted the witemple-msft/fn-fixes branch June 5, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:core Issues for @typespec/compiler meta:website TypeSpec.io updates tspd Issues for the tspd tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants