local TableOfVariables = {
["Name"] = "Part Name"
}
local Part:BasePart = Instance.new("Part")
for i:string,v:any in pairs(TableOfVariables) do
Part[i] = v
end
Expected Behavior
The formatting should be correct without it displaying a red “malformed” underline.
Actual Behavior
There is a red “malformed” underline displayed under the “malformed” text, stating that Expected type table, got 'BasePart' instead when the variable is defined.
Images
Issue Area: Studio Issue Type: Other Impact: Low Frequency: Constantly Date Last Experienced: 2022-07-25 00:07:00 (-05:00)
I made this post to report to Roblox, but I also wanted to know if anyone else is getting this issue as it is bothering me since I like to make sure my code has no errors.
Weird, it sometimes happens and sometimes doesn’t.
This doesn’t error have the error;
But this does;
It may be due to how i in the for loop could be any string and treats assigning the strings like a table variable instead of a property. That’s the best I could explain it.
That is very weird as I never use --!strict unless I really have to. I have no idea how it occurs for some but not all. I’ll definitely look into things on my end and see if that may be my issue or not.
In case this helps, here are my script settings outside of the colour customization:
Also, from what I know, there are no errors in the output. It’s only an error in the Script Analysis tab (In which usually doesn’t have any problems when running scripts)