I remember reading a post that addressed exactly this, however I was unable to find it, so if someone knows which post it was, please do link it. The issue still persists so I decided to bring it up again.
Currently, when you provide invalid arguments to a class constructor, they return “blank identity” instances of that class.
For example, Vector3.new("hi") returns an instance of Vector3 at the origin. An exception should have been thrown because no overload exists that takes a string. It is a common mistake to call it with another Vector3, like Vector3.new(part.Position), which also returns a new vector at the origin, which may be confusing for beginners.
It happens with pretty much every constructor I’ve seen, like BrickColor.new returning Medium stone grey, UDim2.new returning {0, 0}, {0, 0}, etc. The only exception seems to be the Instance.new constructor.
If this is addressed, it would improve the debugging experience for programmers out there who may not know what they did wrong with the arguments.
Both, BrickColor.new({ }) returns medium stone grey, BrickColor.new(coroutine.create(function() end)), BrickColor.new("sup bro") also returns medium stone grey.
Instance.new isn’t the only constructor that errors with bad arguments, some examples of DataTypes which error on bad arguments to the constructor: PluginDrag, DockWidgetPluginGuiInfo, ColorSequence, ColorSequenceKeypoint, NumberRange, NumberSequence, NumberSequenceKeypoint, PathWaypoint, Ray, Random, Rect, Region3, Region3int16, TweenInfo, and BrickColor