#E0148: character that only looks like a token
Code holds a character that looks like an ASCII token but is another one: − (MINUS SIGN) for -, curly quotes for ", a fullwidth ( for (. These come from word processors and web pages. Write the ASCII token the message names; the quick fix replaces it.
nabi
let d = 10 − 3;
println(f"{d}");
error[E0148]: `−` (U+2212 MINUS SIGN) looks like `-` but is another character --> main.nabi:1:12 | 1 | let d = 10 − 3; | ^ | = help: write `-`
Write the ASCII token:
nabi
let d = 10 - 3;
println(f"{d}");
7
A look-alike is only reported where the token it resembles exists: a package that registers − itself as an operator (6.7) makes it a token of its own, and an operator symbol that nothing registers is E0001.
Related: E0001 unexpected character in source, E0147 invisible character in code
Found a mistake? Edit this page on GitHub. Last updated