Closed
Description
Bug report
Bug description:
The rules which are affected are here:
Line 1371 in 6a4528d
Typically I believe they should read
invalid_def_raw:
| ['async'] a='def' NAME [type_params] '(' [params] ')' ['->' expression] ':' NEWLINE !INDENT {
RAISE_INDENTATION_ERROR("expected an indented block after function definition on line %d", a->lineno) }
invalid_class_def_raw:
| 'class' NAME [type_params] ['(' [arguments] ')'] NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }
| a='class' NAME [type_params] ['(' [arguments] ')'] ':' NEWLINE !INDENT {
RAISE_INDENTATION_ERROR("expected an indented block after class definition on line %d", a->lineno) }
to allow proper error reporting if the definition uses type parameters.
CPython versions tested on:
3.12
Operating systems tested on:
No response
Linked PRs
- gh-110938: Fix error messages for indented blocks with functions and classes with generic type parameters #110973
- gh-110938: Add several missing syntax tests for PEP695 funcs and classes #110986
- [3.12] gh-110938: Fix error messages for indented blocks with functio… #110990
- [3.12] gh-110938: More syntax tests for PEP695 funcs and classes (GH-110986) #111023