When compile this script, I encounter Type Mismatch error:
var V: Variant;
begin
V := ''Test'';
UpperCase(V);
end.
If change V to string, it compile without error:
var V: string;
begin
V := ''Test'';
UpperCase(V);
end.
The issue happens to changes of uPSCompiler.pas in commit 1cabc17
else if Tmp.ExpectedType = FAnyString then begin
Tmp.ExpectedType := GetTypeNo(BlockInfo, tmp.Val);
if not IsStringOrCharType(Tmp.ExpectedType.BaseType) then
begin
MakeError('', ecTypeMismatch, '');
Cleanup;
exit;
end;
end;