diff --git a/Source/uPSCompiler.pas b/Source/uPSCompiler.pas index f13307e2..89b704f1 100644 --- a/Source/uPSCompiler.pas +++ b/Source/uPSCompiler.pas @@ -3287,7 +3287,10 @@ function TPSPascalCompiler.IsCompatibleType(p1, p2: TPSType; Cast: Boolean): Boo ((p1.BaseType = btUnicodeString) and (p2.BaseType = btWideChar)) or ((p1.BaseType = btUnicodeString) and ((p2.BaseType = btString) or (p2.BaseType = btPchar) or (p2.BaseType = btUnicodeString))) or ((p1.BaseType = btUnicodeString) and (p2.BaseType = btWidestring)) or - (((p1.basetype = btPchar) or (p1.BaseType = btString)) and (p2.BaseType = btWideString)or (p2.BaseType = btUnicodeString)) or + (((p1.basetype = btPchar) or (p1.BaseType = btString)) and + // the second/third term used to dangle outside the p1 check, which + // made EVERY destination type compatible with UnicodeString sources + ((p2.BaseType = btWideString) or (p2.BaseType = btUnicodeString))) or (((p1.basetype = btPchar) or (p1.BaseType = btString)) and (p2.BaseType = btWidechar)) or (((p1.basetype = btPchar) or (p1.BaseType = btString)) and (p2.BaseType = btchar)) or {$ENDIF}