The current Pest grammar rules
expression_postfix = ${ keyword_or_identifier ~ access+ }
access = { access_array | access_tuple | access_call | access_member | access_static_member}
allow expressions like
self[5] // access_array
self.2 // access_tuple
self(x) // access_call
self::f // access_static_member
none of which is type-correct because self
is always a circuit value. So only expressions like
self.m // access_member
are allowed.
While the compiler can reject the ill-typed expressions above post-parsing, we may consider restricting the grammar to allow only access_member
after self
.