That’s because you’ve spelled length as lenght ![]()
It’s always a good idea to run your function before using @code_warntype because it can be tricky to tell the difference between real type instabilities and issues caused by plain old errors in your code.