> For the complete documentation index, see [llms.txt](https://docs.sannybuilder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sannybuilder.com/troubleshooting/errors/0127.md).

# 0127: Unexpected mission label in function

Compiler found a mission start [label](/language/control-flow/labels.md) inside a [function body](/language/functions.md#function-body):

```pascal
DEFINE MISSION 1 AT @mission1

function foo
:mission1 // Unexpected mission label mission1 in function foo
end
```

#### Possible solutions:

* give the label a unique name:

```pascal
DEFINE MISSION 1 AT @mission1

function foo
:label
end
```

* check that the function body ends before the mission label:

```pascal
DEFINE MISSION 1 AT @mission1

function foo
end

:mission1
```
