Lyricdev
GitHub

LYR-LEX0008

a character literal that holds no character or several

error ยท spec 01-lexical

Between the quotes of a character literal stand no characters ('') or more than one ('ab'). An escape counts as one.

Explanation

A character literal is one character, a Unicode scalar value: 'a', '\n', '๐Ÿ˜€'. Text of any other length is a string.

Write one character, or write the text as a string in double quotes.

Wrong

fn main(): void {
    let c = 'ab';
    let _ = c;
}
fn main(): void {
    let c = 'a';
    let _ = c;
}