Skip to content

TP0006

Error: invalid f-string

From the golden case tests/cases/m1/tp0006_fstring.tpn:

tp0006_fstring.tpn
let a = f"a}b"
let b = f"{ }"
let c = f"{f"x"}"

The compiler reports:

tp0006_fstring.tpn:1:12: error TP0006: single '}' is not allowed in an f-string
tp0006_fstring.tpn:2:11: error TP0006: empty f-string hole
tp0006_fstring.tpn:3:12: error TP0006: f-strings cannot be nested

The specification lists every code.