edubart / nelua-lang

Minimal, efficient, statically-typed and meta-programmable systems programming language heavily inspired by Lua, which compiles to C and native code.
https://nelua.io
MIT License
1.99k stars 64 forks source link

Feedback for documentation of record_inheretance #215

Closed Sticky-fingerz closed 1 year ago

Sticky-fingerz commented 1 year ago

This url example function overrideable() doesn't seem to compile without return. https://github.com/edubart/nelua-lang/blob/master/examples/record_inheretance.nelua

Even If return void function, needs to return nil.

This is not working

function a:foo() ## overrideable() 
end
function b:foo() ## override() 
end

This is working

function a:foo() ## overrideable() 
  return nil
end
function b:foo() ## override() 
  return nil
end

This is related to lua specification,may be not a bug. But the link don't mention it,a little confusing. Because it might help someone,I leave a note.