#Expected type table, got 'BasePart | Model' instead

20 messages · Page 1 of 1 (latest)

west fractal
#

LuaU's type checking system never ceases to amaze me

like what, why does it think type is table when i literally specified BasePart | Model ?

#

and the key Parent exists in both BasePart and Model

lunar shuttle
#

wtf

#

show the typechecking

west fractal
#

this is the initial type i defined for part

it's then narrowed down to be just BasePart | Model here

lunar shuttle
#

I'm not 100% sure you can typecheck robloxclasses im pretty sure they only work with vanilla lua

#

try doing part instead of basepart

west fractal
#

you can, type checking is a thing that is introduced only by LuaU, it's not even in vanilla lua

dreamy timber
#

is Inventory a table?

lunar shuttle
#

ah you can mb

west fractal
lunar shuttle
#

huh weird

west fractal
#

i found a devforums post

#

the solution makes zero sesnse

#

adding local part = part fixes it for some reason??

#

im not even gonna ask

dreamy timber
#

doesnt that just Disable typeChecking?

west fractal
#

actually yeah it does

lunar shuttle
# lunar shuttle

the thing is is that if you only had one parameter is doesnt show up with any unknown errors