While it shouldn't cause an internal error, it is an invalid expression. The reason is that @s is not constant (it's the address on the stack of the ansistring, which can be different every time the function gets called). At least FPC has no support for initialising variables with non-constant expressions.