New type solver infers properties incorrectly when cloning

When cloning an instance, the type solver seems to pick up and directly type cast each of the instance’s properties to whatever it is currently. This causes issues, as some properties, such as object values, can change types.

Here’s an example of the problem:

Here is the relevant code from the above snippet:

local BoundingPart = script.SpawnBoundingPart:Clone()
...
BoundingPart.Parent = workspace

I believe the new type solver is picking up that the parent type of the cloned “BoundingPart” is supposed to be ModuleScript (since it’s a child of the script itself. When assigning to Parent again, it seems to expect a ModuleScript parent.

Expected behavior

Works as normal, without extremely strict inference.

2 Likes

Same problem reported here: