Error codes

E0008: malformed string interpolation

In a terminal: auk explain E0008 prints this page.

On this page

Inside a string, { starts an interpolation {expr} or {expr:spec}. This one is empty, never closed, or has something other than } or : after its expression.

Wrong#

auk
fn braces(): str = "empty: {}"

Fixed#

auk
fn braces(): str = "empty: {{}}"

Common causes#

  • Literal braces in text (JSON, code): write {{ and }}.
  • A { whose } is missing.
  • Two expressions in one interpolation ({a b}): use {a} {b}.
  • A format spec without the : ({x .2}): write {x:.2}.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page