aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[compiler] Error message when wrongly using string constants is not useful

Open wrwg opened this issue 6 months ago • 0 comments

Supposed you start with Move and try to create a string constant

 string::utf8("<empty>")

There is a b"..." missing in front of the string, but the error you get is:

error: invalid character
   ┌─ /Users/wrwg/play/tn/sources/hello.move:21:35
   │
21 │             Empty => string::utf8("<empty>"),
   │                                   ^ Invalid character: '"'

To figure the solution is hard for Move beginners.

wrwg avatar Aug 21 '24 15:08 wrwg