The state of compiler technology has changed a lot since the development of the first C compiler. Compilers have become much smarter about things on their own, including the intended type of expressions, without the help of programmers.
Char's output against string literals is one such example. Theoretically, the current structure of C allows us to deduce the type of literal in many contexts. For example, in the code below, the compiler has enough information to handle single-character strings, as if they were character literals:
void foo(char c); char s[] = "xyz";
However, at the same time, it was easier to ask the programmer to tell the compiler that "a" , "b" and "c" are actually 'a' , 'b' and 'c' . Moreover, since function prototypes were not introduced until the ANSI C, foo("b") assumption was found in the original version of the K & R language.
The help of a programmer is no longer required when the language has a type inference system, so Swift designers decided to combine the syntax for string and character constants.
source share