mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
fix impl of pep695
This commit is contained in:
parent
9914c4838c
commit
697312cae5
@ -2269,8 +2269,10 @@ static Error* consume_pep695_py312(Compiler* self) {
|
||||
// https://peps.python.org/pep-0695/
|
||||
Error* err;
|
||||
if(match(TK_LBRACKET)) {
|
||||
do {
|
||||
consume(TK_ID);
|
||||
if(match(TK_COLON)) { check(consume_type_hints(self)); }
|
||||
if(match(TK_COLON)) check(consume_type_hints(self));
|
||||
} while(match(TK_COMMA));
|
||||
consume(TK_RBRACKET);
|
||||
}
|
||||
return NULL;
|
||||
|
@ -15,3 +15,7 @@ assert res == 3
|
||||
|
||||
test = Test(1)
|
||||
assert test.get_value() == 1
|
||||
|
||||
# test multiple
|
||||
class Test2[T: int, U]: pass
|
||||
class Test3[T: int | str, U: float, R: list]: pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user