Auto Object Creation Type Checking | Similar to [Instance.new("ObjectName")]

THE IDEA:

Do you know how Instance.new(“RandomClassName”) returns Object and…
Probably wondering how the object autocompletes regardless of where you put the object.

THE GOAL:

Types for vaild entries
image
Return Object Types
image

THE AVERAGE WAY:

I found a method while learning type checking,
A lot of my scripter friends say you would to manually type out a types module library, require that everywhere you code, and assign the types like:

local VarName : VarType = ObjectCreationFunctionName("ClassName")

This method works but is annoying

EXAMPLE WAY:

(Remember this isn’t done in --!strict)

The Object are sorted by what conditions is needed to be insert for the function, to give what corresponding result

Because the value function type Barrack given argument matches with “Barrack” it returns it’s function type return type, to object the function returned!

and if you want that class types autocomplete make sure you assign the given arguments a type like 43

resulting in:

other post of mine:
Search in Numbered Table | w/ 0% LOOPING! - Resources / Community Resources - Developer Forum | Roblox