s2: Ts; // Initialisation to Nil results in compile error here
Does not, it works correctly.
Yes I had a typo, now this works.
However the error message is still rather dubios.
It says: "Expected Boolean got Char" and the cursor is at pos 5 where a boolean is.
Should the specialists decide, if this is intentional and correct.
Normally the cursor should be at the error position.
Then my way to read is correct, if there is type inference.
I removed delphi, so I cant test it, but in Delphi this should be possible:
for var c in arr do; and the type of c is automatically determined, and if they do it really clever, c is an implicit reference variable.