fix(check): 0.R4 - a misspelled type in a parameter, a result or a field is refused where it is written
`function kind_of(f: CharFact)` for a CharacterFact was taken on trust and failed in the code writer as "member access on non-aggregate". A capitalised type - plain, in a slice, or a generic's argument - must name a declared property, record, state, event, enum, action or packed value type, or a type parameter of its declaration: `kind_of's parameter f: there is no type CharFact`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c35481f344
commit
2eefae0618
10 changed files with 13423 additions and 10801 deletions
|
|
@ -401,7 +401,10 @@ What it holds apart: `int`, `float`, `fixed` and `bool` (a float or a fixed into
|
|||
text and numbers (`string(n)` or a template); one record type and another; slices of different
|
||||
elements; functions of different types. A call gives exactly as many arguments as there are
|
||||
parameters, a `return` gives the declared result, and `push` gives the slice's own element. A
|
||||
function names each parameter once (`add names two parameters n`).
|
||||
function names each parameter once (`add names two parameters n`). A type written in a parameter, a
|
||||
result or a field names a declared type (or one of the declaration's type parameters): a misspelling
|
||||
is refused there (`kind_of's parameter f: there is no type CharFact`), not later as a member access
|
||||
that makes no sense.
|
||||
|
||||
`pointer` is untyped, as `void *` is in C: it goes wherever a reference is wanted and takes any
|
||||
reference, and a `[]pointer` any slice of references. Restricting what a raw pointer may reach is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue