Open
Description
This normally doesn't matter much unless the userdata struct itself is generic. E.g.
pub struct Foo<T: FooerTrait> {
pub foo: T
}
impl LuaUserData for Foo<T> {
<some code here that defines methods and fields, particularly a __type metamethod on Luau>
}
In luau, ops like type() and even the debug display will use __type
correctly however argument conversion errors (forgetting to use method syntax etc) uses the full type name instead of the __type
metamethod set. This leads to longer/harder to read error messages, especialy if the name of T is long (e.g. Foo<TestingFooerTrait>
instead of Foo
in argument conversion errors assuming __type
is set to Foo
)
Due to backward compatibility reasons and cases where this behaviour is not desired however, this should probably be a flag (either in LuaOptions
or in UserData itself)
Metadata
Metadata
Assignees
Labels
No labels