-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
If I have a type bound to Lua, I can construct like so:
v = vec4.new(1,2,3,4)However, .new will also take any extra arguments and ignore them:
v = vec4.new(1,2,3,4,'foo', 'bar?')
-- v is a valid vec4, no errorMaybe these cases should be rejected?
This can lead to confusion if we hav, eg. vec2, vec3, vec4, like so:
-- It looks like we meant to create vec4
-- If we don't notice the '2' character, it is confusing.
v = vec2.new(10,20,30,40)I don't know kaguya's internals, but couldn't the constructor (or other functions) check lua_gettop when they're called?
Metadata
Metadata
Assignees
Labels
No labels