> 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/0118.md).

# 0118: Unexpected value to return

Compiler found a value that can't be [returned from a function](/language/functions.md#return-from-function). Functions can only return numbers (integer or float), strings, or single variables. Arrays or other complex values are not supported. Also, you can't put random words after `return` keyword:

```pascal
function foo  
    return value // Error: Unexpected value to return: value
end
```

#### Possible solutions:

* for each corresponding return type, provide a correct value that is either a number or a string, or a variable of the same type

```pascal
function foo
  return 42
end
```
