Docs menu

E114: The same name is declared twice in one declaration

What compiler error E114 means, and how to fix it.

Inside a struct, an enum, an error type or a machine, every member needs its own name. Turf found a second member with a name that was already taken, and with two of them it couldn’t tell which one you meant.

Example
struct User {    name: string,    name: int            // `name` is already a field}enum Color { Red, Green, Red }machine Door { Open -> Closed, Open -> Closed }     // the same transition twice

Rename one, or delete the extra one:

Example
struct User {    name: string,    age: int}

(This is about members. Declaring two variables with the same name in one scope is a different mistake – see E033.)

Run turf --explain E114 in a terminal to read this again.

Last updated: Oct 15, 2026Edit this page on GitHub

Esc

Type to search.