inferRecordDeclaration

Infers a record declaration for the given type. type is the object type representing a record that we want to infer. The kind specifies if we create a class or a struct.