Delphi Error – W1050 WideChar reduced to byte char in set expressions

Delphi Compiler Error

W1050 WideChar reduced to byte char in set expressions

Reason for the Error & Solution

“Set of char” in Win32 defines a set over the entire range of the Char type. Since Char is a byte-sized type in Win32, this defines a set of maximum size containing 256 elements. In .NET, Char is a word-sized type, and this range (0..65535) exceeds the capacity of the set type.

To accomodate existing code that uses this “Set of Char” syntax, the compiler will treat the expression as “set of AnsiChar”. The warning message reminds you that the set can only store the boolean state of 256 distinct elements, not the full range of the Char type.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...