#Casting issue with a custom type

1 messages · Page 1 of 1 (latest)

inner junco
#

export type Viewmodel = typeof(ViewmodelClass);

#

so put them in viewmodelclass then

#

also setmetatable(objdata,etc) is definitely not the same type as ViewmodelClass - this has no metatable, while your objdata does have a metatable.

#

maybe try doing this instead

#

export type Viewmodel = typeof(setmetatable({}::ViewmodelData,ViewmodelClass))

#

i didn't notice that first time i looked at this :p

#

though i'm not sure how that casting an empty table is going to go since viewmodeldata has required fields

#

there's no way to avoid making a "placeholder" for tables with a metatable. it's the only way to get a type with a metatable on it

#

typeof() is required for that