Skip to content

TP0208

Error: not all paths return a value

  • not all paths in '<f>' return a value

From the golden case tests/cases/m11/tp0208_nested.tpn:

tp0208_nested.tpn
def outer() -> int:
def inner(x: int) -> int:
if x > 0:
return 1
return inner(1)

The compiler reports:

tp0208_nested.tpn:2:9: error TP0208: not all paths in 'inner' return a value

The specification lists every code.