Skip to content

Validate function type parameter default order - #25981

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/fix-function-type-parameter-default-order
Jun 14, 2026
Merged

Validate function type parameter default order#25981
charliermarsh merged 1 commit into
mainfrom
charlie/fix-function-type-parameter-default-order

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

Function type parameter lists did not run the same default-order validation as class and type-alias parameter lists. As a result, we accepted functions with a required type parameter after one with a default:

def f[T = int, U](): ...

This reuses the existing type-parameter ordering check for function definitions, so we now report the same semantic syntax error that we already emit for equivalent classes and type aliases.

@charliermarsh charliermarsh changed the title [syntax-errors] Validate function type parameter default order Validate function type parameter default order Jun 14, 2026
@charliermarsh charliermarsh added the parser Related to the parser label Jun 14, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@charliermarsh
charliermarsh marked this pull request as ready for review June 14, 2026 14:47
@astral-sh-bot

astral-sh-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@charliermarsh
charliermarsh merged commit 39b09a9 into main Jun 14, 2026
58 checks passed
@charliermarsh
charliermarsh deleted the charlie/fix-function-type-parameter-default-order branch June 14, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parser Related to the parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants