E3024 Types Errors

Types

function '%s' must return a value but has no return statement

When this occurs

Function declares return type but has no return statement

Example error message

error[E3024]: function 'calculate' must return a value of type 'int'

How to fix

Add a return statement with a value matching the declared return type.

Related errors